Home » Developer & Programmer » Data Integration » How can I call an Oracle Stored Procedure using ADO?
How can I call an Oracle Stored Procedure using ADO? [message #92870] Wed, 28 November 2001 11:30 Go to next message
Simiyu
Messages: 2
Registered: November 2001
Junior Member
How can call an Oracle 8i Stored Procedure and pass IN 21 parameters using ADO through Visual Basic 6.0. Any suggestions or sample code will be appreciated. Thanks.

----------------------------------------------------------------------
Re: How can I call an Oracle Stored Procedure using ADO? [message #92874 is a reply to message #92870] Thu, 06 December 2001 19:43 Go to previous messageGo to next message
Satish Shrikhande
Messages: 167
Registered: October 2001
Senior Member
Execute a procedure with one input and 2 output parameter .

Create or replace PROCEDURE GET_USER_NAME
(
userid in number,
firstname out varchar2,
lastname out varchar2
)
as
Begin
select last_name, first_name
into lastname,firstname
from t_cms_user where user_id = userid;
end;

============

Private Sub Command1_Click()
Dim objConn As New ADODB.Connection
Dim objRec As New ADODB.Recordset
Dim objComm As New ADODB.Command
Dim strConn
Dim pr As New ADODB.Parameter
Dim pr1 As New ADODB.Parameter
Dim pr2 As New ADODB.Parameter

strConn = "Provider = MSDAORA.1;User ID=satish;password=satish;Persist Security Info=False"

objConn.open strConn
With objComm

.CommandType = adCmdStoredProc
.CommandText = "get_user_name" 'procedure name
Set pr = .CreateParameter("user_id", adInteger, adParamInput)
pr.Value = 101
Set pr1 = .CreateParameter("fname", adVarChar, adParamOutput, 30)
Set pr2 = .CreateParameter("lname", adVarChar, adParamOutput, 30)

.Parameters.Append pr
.Parameters.Append pr1
.Parameters.Append pr2

.ActiveConnection = objConn

End With
Set objRec = New ADODB.Recordset
objComm.Execute
MsgBox "First name " & pr1 & " Last name " & pr2
End Sub

----------------------------------------------------------------------
Re: How can I call an Oracle Stored Procedure using ADO? [message #92902 is a reply to message #92870] Tue, 12 February 2002 11:14 Go to previous messageGo to next message
alexis
Messages: 2
Registered: February 2002
Junior Member
is it possible to do this without configuring a TNS entry in the Oracle server (by setting the information in the code)?
How can I call an Oracle Stored Procedure using ADO in C++ [message #92943 is a reply to message #92870] Wed, 08 May 2002 13:47 Go to previous messageGo to next message
Harish
Messages: 25
Registered: February 2001
Junior Member
How can call an SQL Stored Procedure and pass input and oupt parameters using ADO through Visual C++ 6.0.
Any suggestions or sample code will be appreciated. Thanks.
Harish
Re: How can I call an Oracle Stored Procedure using ADO? [message #92971 is a reply to message #92870] Wed, 26 June 2002 05:51 Go to previous messageGo to next message
Manoj Nirbhay
Messages: 1
Registered: June 2002
Junior Member
I want fully idieas of procedurs using Oracle
Re: How can I call an Oracle Stored Procedure using ADO? [message #93292 is a reply to message #92874] Sun, 30 May 2004 10:19 Go to previous messageGo to next message
Prabhakar
Messages: 9
Registered: April 1999
Junior Member
Excellent boz. Thanks a lot and I appreciate your coding skills.

Cheers
Prabhakar
How to call using oracle? [message #93384 is a reply to message #92870] Fri, 15 October 2004 04:40 Go to previous message
Demetris
Messages: 1
Registered: October 2004
Junior Member
How to call using oracle? Any suggestions will be helpful.
Previous Topic: query on Match and Merge Functionality of OWB
Next Topic: Question
Goto Forum:
  


Current Time: Fri Aug 14 15:29:00 CDT 2020