473,626 Members | 3,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enterprise Library 2006 -- Calling Oracle Procedure with Parameters

Hello All,

I am completely stuck, I have tried for an entire day to get a simple
procedure call to my Oracle Db via the enterprise Library 06. I am not
an oracle fan to start, but have to deal with it for now. I am only
trying to retrieve data into a dataset from the oracle procedure,
nothing fancy! Here is my 100th version of code I have.
[ORACLE PROCEDURE I AM CALLING]

PROCEDURE "METLAB"."GET_L OOKUPS_PRC" (
"P_LOOKUP_T YPE" IN VARCHAR2, P_RETURNSET OUT SYS_REFCURSOR) IS

BEGIN

OPEN P_RETURNSET FOR

SELECT LOOKUP_ID,
LOOKUP_VALUE,
LOOKUP_TYPE
FROM MRLOOKUPS
WHERE LOOKUP_TYPE = P_LOOKUP_TYPE
ORDER BY LOOKUP_VALUE ASC;

NULL;

END "GET_LOOKUPS_PR C";
[code] [#01]
OracleDatabase db = new OracleDatabase( dbConn);
DbCommand objComm = db.GetStoredPro cCommand("GET_L OOKUPS_PRC");

db.AddInParamet er(objComm, "P_LOOKUP_TYPE" ,DbType.String, "NACE");
db.AddOutParame ter(objComm, "P_RETURNSET",D bType.Object,80 00);

objDS = db.ExecuteDataS et(objComm);
I would really like to continue writing the code similar to what I have
been doing with the Application Block previous. [HERE IS WHAT I AM USE
TO]
//Create Sql Parameters for SP
SqlParameter[] arrParms = new SqlParameter[3];
arrParms[0] = new SqlParameter("@ p_UserName", arr[0]);
arrParms[1] = new SqlParameter("@ p_DbId", arr[1]);
arrParms[2] = new SqlParameter("@ p_AddRemove",
GetAddRemove((( CheckBox)sender ).Checked));

//Update the records//
SqlHelper.Execu teNonQuery(strC onnection,
CommandType.Sto redProcedure, "up_AddOrRemove Perms", arrParms);

[MY CLOSEST ATTEMPT FOR THE ORACLE SIDE OF IT .. STILL DOESN'T WORK]
[#02]
Dataset objDS = new Dataset;
OracleParameter[] arrParams = new OracleParameter[2];

arrParams[0] = new
OracleParameter ("P_LOOKUP_TYPE ",OracleType.Va rChar,50);
arrParams[1] = new OracleParameter ("P_RETURNSE T", OracleType.Curs or);
objDS = db.ExecuteDataS et("GET_LOOKUPS _PRC", arrParams);

THE ERROR FOR [#02]
"Object must implement IConvertible"

ANY DOCUMENTATION LINKS OR HELPFUL SOURCE CODE FOR ORACLE USING THE
ENTERPRISE LIBRARY WOULD BE MUCH APPRECIATED.

Thank in advanced!!
Spence

Aug 31 '06 #1
0 1398

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
11282
by: stephane.traumat | last post by:
Hello, I already succeed to call a stored procedure in Oracle but only simple ones with one output value and several inputs. I don't any idea left so any help would be great :) Thanks But on one procedure, i'm having a prb: I get an error: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too smalljava.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
1
6183
by: Jason Leiser | last post by:
Is there a way to call an Oracle Procedure using the MS OLD DB Provider for Oracle object in a SQL Server 2000 DTS package? If it can't be done this way, is there another way to retrieve data from an Oracle database using an Oracle procedure to a SQL Server table? Also, can parameters be passed into Oracle from SQL Server via a procedure? Our Oracle DBA does NOT want to create views to enable SQL Server to access the data. Examples...
0
1896
by: Error while executing SP | last post by:
Hi, I am getting an error while executing a sp from Oracle database. Can you let me know what could be the problem? here is the code using(System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection()) { cn.ConnectionString="Provider=OraOLEDB.Oracle;Password=STORED_OBJ;User ID=STORED_OBJ;Data Source=PDCDGL1.NA.HPFS.COM;Extended Properties=;Persist Security Info=False;PLSQLRSet=1;"; cn.Open(); //String strProcName =...
1
4350
by: Mike Chamberlain | last post by:
Hi all. I'm trying to extend the Microsoft Enterprise Library Data Access Application Block (http://msdn.microsoft.com/library/en-us/dnpag2/html/daab.asp?frame=true) to work with a Borland Interbase database. To do this, I copied and renamed the source files for working with a SQL Server database (SqlCommandWrapper.cs/SqlDatabase.cs to InterbaseCommandWrapper.cs/InterbaseDatabase.cs). I then changed all
2
4363
by: Raj | last post by:
Hi, Does anybody know how to call an oracle stored procedure ( with parameters ofcourse) from MS Access 2002. I want to invoke an oracle stored procedure which takes 2 parameters. Thanks, Raj.
2
4919
by: ssp | last post by:
Hello there, I am trying to do very simple thing in trying to return results from an Oracle (10g) Stored Procedure using the Enterprise Library June 2005 Version. The stored procedure first: ============================================ CREATE OR REPLACE PROCEDURE AGENCYSELECTALL(p_cursor OUT SelectPackage.SelectCursor)
1
4825
by: C#_Beginner | last post by:
I was wondering if someone can help me out. I'm getting the following error: Message: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7: PLS-00306: wrong number...
3
8414
by: Muhammad Intikhab Qaiser | last post by:
Hi I have following code and problem in calling the oracle stored procedure "DEPTREE_FILL" Here is the Code: Command.Connection = connection; Command.CommandText="deptree_fill".ToUpper(); Command.CommandType = CommandType.StoredProcedure;
23
3399
by: Gloops | last post by:
Hello everybody, Is anyone able to give me some indications about how to develop an Access interface for an Oracle database ? I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i 9.2.0.1.0 and ODBC 3.525.1117.0, on Windows XP Pro 5.1.2600 SP2 Nu 2600. I failed executing an Oracle stored procedure from Access, and a trigger to store data to a temporary table was active from SQL*Plus, but
0
8265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.