Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Call Oracle Procedure from Excel macro

Hi ALL
I need to call a Oracle Procedure from Excel Macro?
Does anybody know How to do it?
Any code samples?
My procedure has 5 IN parameters and 1 OUT parameter.
I was thinking of using ODBC to connect to the database.
Please help...........urgent.........
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Call Oracle Procedure from Excel macro

I can't answer all of your questions for Oracle, but I have successfully done
this with PeopleSoft using ADO. I hope the following will set you on track
for looking at the appropriate arguments at least:

Set ADO "CommandText" to your stored procedure name and then set the
"CommandType" to "adCmdStoredProc"

e.g:
cnADO.CommandText = myStoredProcedureName
cnADO.CommandType = adCmdStoredProc

You don't specify if you are returning records or not; my example returns
records. So your code might look something like:

Dim adoCM As ADODB.Command
Dim adoCN As ADODB.Connection
Dim adoRS As ADODB.Recordset

Set adoCN = New ADODB.Connection
adoCN.CursorLocation = adUseClient
adoCN.Properties("Prompt") = adPromptComplete '<this is for logon not param

adoCN.Open "ODBC;YOUR_ConnectionString_for_Oracle;"

Set adoCM = New ADODB.Command
Set adoCM.ActiveConnection = adoCN
adoCM.CommandText = YourProcedureName
adoCM.CommandType = adCmdStoredProc

'Run query and populate a recordset
Set adoRS = New ADODB.Recordset
Set adoRS = adoCM.Execute

In PeopleSoft I was able to build-in the prompts into the stored procedure
on the PeopleSoft side, I don't know how to do that for Oracle or if you even
can...

HTH somehow.

"test" wrote:

Hi ALL
I need to call a Oracle Procedure from Excel Macro?
Does anybody know How to do it?
Any code samples?
My procedure has 5 IN parameters and 1 OUT parameter.
I was thinking of using ODBC to connect to the database.
Please help...........urgent.........
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Call Oracle Procedure from Excel macro

Also, there is a product from Oracle called "Oracle Objects for OLE". It's
downloadable form Oracle. It allows you to attach to the database and
retrieve data, change data, run procedures, etc.

I haven't actually used it to run procedures, yet, but it says that it can.

Here's a link to Oracle's description of it:

http://www.oracle.com/technology/tec...4O_O9i_FO.html
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Call Oracle Procedure from Excel macro

Thanks for your input guys.
But still need someone to tell me hoe to call a sp from excel.





"mark" wrote in message
...
Also, there is a product from Oracle called "Oracle Objects for OLE".

It's
downloadable form Oracle. It allows you to attach to the database and
retrieve data, change data, run procedures, etc.

I haven't actually used it to run procedures, yet, but it says that it

can.

Here's a link to Oracle's description of it:

http://www.oracle.com/technology/tec...4O_O9i_FO.html



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
Is it possible to run an Oracle PL\Sql procedure within Excel? mowee Excel Discussion (Misc queries) 1 January 22nd 10 03:54 PM
Is it possible to run an Oracle PL\Sql procedure within Excel? mowee Excel Discussion (Misc queries) 0 January 22nd 10 03:04 PM
How can Oracle DB Stored procedure be called in MS Excel? Amol Excel Discussion (Misc queries) 1 January 7th 07 10:05 AM
How to call a stored procedure in a macro Lee Dengo Excel Programming 2 May 12th 04 06:46 PM
call procedure bob Excel Programming 1 August 9th 03 12:40 AM


All times are GMT +1. The time now is 06:25 AM.

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

About Us

"It's about Microsoft Excel"