QuestionHow get output from Oracle DB returns RefCursor?

Hi

I hvae typed DataSet contains some stored pocedures one of them returns RefCursor like this:

GetDataById(Id, out RefCurso)

how can I set type of returned type (RefCursor returns recordset)

I want to use DataSet or DataTable inside this function to catch output from Oracle stored procedure...


I looking for some thing like this 

DataSet DS= new DataSet();
GetDataById(10, DS)
0
faysel
4/28/2009 8:53:18 AM
asp.net.oracle 2269 articles. 0 followers. Follow

1 Replies
743 Views

Similar Articles

[PageSpeed] 12

 You can use the following code to get hold of the cursor

 

OracleCommand command = new OracleCommand("procedureName");
command.Connection = _connection;
command.CommandType = CommandType.StoredProcedure;
OracleParameter outParam = new OracleParameter();
outParam.ParameterName = "outputParam";
outParam.OracleType = OracleType.Cursor;
outParam.Direction = ParameterDirection.Output;

command.Parameters.Add(outParam);
OracleDataReader reader = command.ExecuteReader();
Hope it will help you. 
  
--
(Please, Mark as Answer if it Helped)
http://smsohan.blogspot.com
0
sohan
4/28/2009 10:03:48 AM
Reply:

Similar Artilces:

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

vb.net function and Oracle procedure to get an Oracle Dataset??
I have similar code (a procedure and function) working perfectly with a sql server data source. I;'m trying to do the same things with Oracle, but have run into the problems.    I'm not an oracle expert, so I'm not sure if producing a cursor is my only and best  option. create or replace package body PK_RETAILER isPROCEDURE sp_Get_Order_History(v_ani IN number,output_cursor out PK_CURSORES.generic_cursor) ASBEGINopen output_cursor forselect o.account_number, p.phone, o.amount, o.name, o.init_datefrom orders ojoin users_phones p on p.account_number...

urgent: .NET Provider for Oracle or Oracle Data Provider for .NET
If I want to access Oracle DB in ASP.NET application, and I am using .NET Provider for Oracle or Oracle Data Provider for .NET, should I have to install OracleClient on my .NET server? Is there other choice? Thank you very much.Johnson Johnson2007:should I have to install OracleClient on my .NET server?  You have to options1. install the ODP.NET on your web serverOR2. put the oracle assemblies in your BIN directory   Hi jimmy,Thank you for you reply. Because I could not find a server right now, I should test it first before I agree or disagree with you, as most articles I...

Problem in getting Oracle function return value using ODP.net
 Dear AllI fall a problem by getting value from oracle function in asp.net. the code is as follows...the oracle function is ...start... create or replace function ultimus.FXN_GET_TRAN_DATE(pBRANCH_ID IN VARCHAR2) return date is-- ********************************************************************************-- Description: Get Branch Working Date-- ================================================================================  Result DATE;begin     Select  DECODE(a.day_status_id, 2, a.TRAN_DT, NULL) AS TRAN_DT      Into Resu...

Oracle as consoldated db and Oracle XE as remote db
Hi, Is it possible to use MobiLink synchronization technology with this configuration? - Oracle as consolidated database and Oracle XE as remote database; or - Oracle as consolidated database and Sybase ASA as remote database. If I'm using option 2, what software licenses do I have to buy for replication and remote databases? Thank you in advance. > Is it possible to use MobiLink synchronization technology > with this configuration? > - Oracle as consolidated database and Oracle XE as remote > database; or This configuration is not really supported at thi...

Where can I get native PB drivers for ( Oracle Version 8.0.0.5) with Oracle Net Client Version 7.3.3
( Oracle Version 8.0.0.5) with Oracle Net Client Version 7.3.3 with SQL *Net version 2.x , 32 bit implementation. All versions of PB Enterprise (5,6,7) have the native O73 driver. If you have PB Professional, you can only use ODBC to connect to Oracle. -- Terry Dykstra (TeamSybase) Canadian Forest Oil Ltd. Check out Sybase Developer's Network: http://www.sybase.com/sdn Veena Madhavi <bveenamadhavi@hotmail.com> wrote in message news:38A8FD91.6218D227@hotmail.com... > ( Oracle Version 8.0.0.5) with Oracle Net Client Version 7.3.3 with SQL > *Net version 2...

.NET Oracle Provider
Hi all,I am using .NET 2.0 Frameworks Oracle provider and it does not have a OracleDbTypes Type for me to use. I would like to create a parameter that is of the Oracle type NVARCHAR, but it seems I can only use DbTypes, which does not have this. If I used DbTypes.String, would this be ok, otherwise, how else can I be more specific about the Oracle Parameter data type?Thanks  can u explain which type of data u r going to storeThank uBaba Thank uBabaPlease remember to click "Mark as Answer" on this post if it helped you. What's your version of ODP? You have OracleD...

Return an Oracle Refcursor
I  am calling a Oracle stored procedure and one of the output parameters is a refcursor.  I would like to return a DataTable so I can populate a grid.  How do I convert/cast a refcursor to a DataTable object? Thanks,Paul  public DataTable getRecords(...){         ...         cmd.Parameters.Add(new OracleParameter("TransLogRefCur", OracleType.Cursor)).Direction = ParameterDirection.Output;        ...        return cmd.Param...

Oracle ODP.net mulitple Oracle Client
To connect to the oracle database using ODP.net, the applicate must add the dll file called Oracle.DataAccess. There are a lot of version of Oracle.DataAccess. As I know, if the client use Oracle Client 10g Release 2. If the client use Oracle Client 10g Release 2, the application also have to use the Oracle.DataAccess the come from Oracle Client 10g Release 2.  My question is that there are any method to add more than one Oracle.DataAccess version in my product to support multiple OracleClient.   That should automatically happen for the most part.  Oracle's ODP.NET i...

Which .Net Provider for Oracle 9i Microsoft or Oracle
Can anyone provide me pros and cons of provider to access Oracle Database ? I am aware of Microsoft Provider and Oracle Provider. Microsoft http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/manprooracperf.asp Oracle http://otn.oracle.com/software/tech/windows/odpnet/utilsoft.html I guess you can use either. But as some post suggests, if both installed, then MS ODP will not work. I've been using DataDirect Technologies Connect for .Net and Oracle. It's not free, so it depends on your budget. The speed improvements were great for us, and it's ni...

which is shou i use? Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NET
Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NETI am confused?Which is better or which one should I use?BTW, I am going to use .net 2.0 with oracle 9. Can anyone tell me what shou I use for working with oracle database?Thanks very much in advance!Justin Oracle's data provider has more functionality than Microsoft's.If your doing transaction processing you can have SAVEPOINTs, which Microsoft's data provider does not provide.Also, Oracle has PL/SQL Associative Arrays which are very powerful.Oracle also allows you to bind parameters by name and pos...

Getting Error Message "Can't load 'C:/Perl64/lib/auto/DBD/Oracle/Oracle.dll" While Connecting to Oracle
--755704646-1080936359-1390695547=:84331 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I am trying to configure an Oracle connection from Perl running on a Window= s 7 desktop to an Oracle 11g database running on Linux; however the databas= e connection step is failing.=0A=0AThe following line of perl code fails:= =0A=0A=A0 =A0use DBD::Oracle;=0A=0ABelow is the full error message:=0A=0ACa= n't load 'C:/Perl64/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:= load_file:%1 is not a valid Win32 application at C:/Perl64/lib/D...

PB 10.5.1 Build 6021 , Oracle 10g server , Oracle 8i client. Making an RPC call to a Oracle Function and the last character is getting truncated
Making an RPC call to a Oracle Function and the last character is getting truncated. Similar Support Case : CR Number: 386424 Case Number: 11158124 I tried Disableunicode = 1 and not working .Is there any other workaround for oracle 8i client. That case was for Oracle 9i server and 8i client. There was a second workaround which was to use the Oracle 9i client. Not sure if that would work for you since you're on Oracle 10g server. > Making an RPC call to a Oracle Function and the last > character is getting truncated. > > Simi...

oracle RAC and Oracle 11gR2 installation with oracle ASM
hi how to perform oracle RAC 11gR2 and Oracle Database 11gR2 installation with oracle ASM on open SUSE 11.1 x86_64?? what short of package to find for oracle ASM and OCFS?? regards -- csayantan ------------------------------------------------------------------------ You need to download the rac and asmlib stuff from oracle. You then need to present san storage to each node. You will then need to stamp each asm lun with /etc/init.d/oracleasm createdisk NAME /dev/sandevice. -- icorson ------------------------------------------------------------------------...

Web resources about - QuestionHow get output from Oracle DB returns RefCursor? - asp.net.oracle

Highest Voted 'complexity-theory' Questions - Stack Overflow
The QuestionHow to find time complexity of an algorithm?What have I done before posting a question on SO ?I have gone through this, this, this ...

Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Goldman May Lose Millions From Ex-Worker’s Code Theft (Update3)
Goldman Sachs Group Inc. may lose its investment in a proprietary trading code and millions of dollars from increased competition if software ...

Answers to burning Palm Pre questions
Here's the stuff they didn't mention during the keynote, including whether there will be a GSM version.

Answers to burning Palm Pre questions
Here's the stuff they didn't mention during the keynote, including whether there will be a GSM version. Read this article by Ina Fried on CNET. ...

Infographic: A Wounded Veteran’s Absurdly Long Wait For Benefits
Think the U.S. is taking good care of its wounded vets? Your mind will change when you see the cold, hard data. When a U.S. veteran files for ...

Instead of Education: Ways to Help People Do Things Better
Support doe Self-Directed Learning, Unschooling, Homeschooling and the Work of John Holt.

Apple MacBook (2008)
A sleek and durable design, strong everyday performance, and good battery life complement Apple's easy-to-use operating system and first-class ...

NRA to school officials: Train and arm a staffer - Seattle Times Newspaper
spin, Llama, spin. Everyone (except the NRA) has admitted that the NRA report has errors. But your response to asking why those errors don't ...

On Demand Advertising Solutions Home of Supercharged Results!
Check out http://ondemandadvertisingsolutions.com! The site that answers the burning questionhow do i get a 200% return on my advertising investment? ...

Resources last updated: 12/20/2015 6:34:44 PM