Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default ADO - how to run proc returning a record

I got to run queries and stored procedures on Oracle DB well-enough using ADO
How can I run a stored procedure that returns a recordset (ref cursor in Oracle parlance)
Could I find one so kind to give me a sample?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ADO - how to run proc returning a record

OK. I got to check MSDN about the provider (MSDAORA.1) that comes with MSOffice, ant it specifically says that it can't handle procedures returning ref cursors. I read that Oracle OLEDB Provider can do that
Still, I'll stick to MSDAORA.1 for it works well for most of the things and it comes with MSOffice

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ADO - how to run proc returning a record

You would have to create the procedure and package on the Oracle D
create or replace package Pack i
type Create_Sales_Lead_Record_type is ref cursor return create_sales_lead_v1%rowtype
--Selected_Sales_Lead Create_Sales_Lead_Record_type
-- Function and procedure implementation

procedure Proc_Get_Sales_Lead(Sales_Lead_ID in Number , Selected_Sales_Lead out Create_Sales_Lead_Record_Type)


end Pack

On .net side
oraTrane = new OracleConnection("user id=;data source=;password=")
Object My_DBNull
My_DBNull = Convert.DBNull
OracleDataReader SalesLeadDetails
OracleCommand GetSalesDetails = new OracleCommand()
GetSalesDetails.Connection = oraTrane
GetSalesDetails.CommandType = CommandType.StoredProcedure
GetSalesDetails.CommandText= "trane_pack.proc_get_sales_lead"
GetSalesDetails.Parameters.Add( new OracleParameter("sales_lead_id", OracleType.Number,0,ParameterDirection.Input,false ,0,0," ", DataRowVersion.Default, My_DBNull))
GetSalesDetails.Parameters.Add( new OracleParameter("Selected_Sales_Lead" , OracleType.Cursor ,2000, ParameterDirection.Output ,false ,0,0," ",DataRowVersion.Default, My_DBNull))
GetSalesDetails.Parameters[0].Value = 1
oraTrane.Open()
SalesLeadDetails = GetSalesDetails.ExecuteReader()


----- BEDE wrote: ----

I got to run queries and stored procedures on Oracle DB well-enough using ADO
How can I run a stored procedure that returns a recordset (ref cursor in Oracle parlance)
Could I find one so kind to give me a sample?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Data -- SQL Server proc or function with parameter lm Excel Discussion (Misc queries) 1 August 21st 09 10:49 PM
Open new record with selected fields from previous record Design by Sue Excel Discussion (Misc queries) 1 June 12th 09 02:24 PM
running proc in excel just_real Excel Discussion (Misc queries) 1 November 21st 08 06:51 AM
Additional file with no extension created during File Save As proc Peter Rooney Excel Discussion (Misc queries) 2 August 11th 05 02:48 PM
Call a proc inside itself (HELP) David Excel Programming 2 February 4th 04 08:28 PM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"