Link to home
Start Free TrialLog in
Avatar of Shanmugam Rajagopal
Shanmugam Rajagopal

asked on

How to save Oracle SP's Cursor output to DataTable

The Oracle SP is returning 2 outputs. One is cursor and another is string. I want to handle both outputs in C# after execution. The 2nd output is error if the query has any issues. If string returned is null or empty I should save the cursor output to a datatable. Please help

Oracle SP is executeSQL(sql_in IN varchar2, p_out package.ref_Cursor, p_err out varchar2)
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

If you aren't using Oracle's ODP.Net data provider, you need to be.  I would suggest the Managed Client since it doen't require an Oracle Client install.

What exactly are you looking for help with?

You can also use the OracleRefCursor class in conjunction with the OracleDataAdapter class to populate DataTables and DataSets.
https://www.oracle.com/technetwork/articles/dotnet/williams-refcursors-092375.html
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.