Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I call stored procedure via ASP?

Status
Not open for further replies.

mimpuerto

Programmer
Mar 19, 2003
5
GB
I have an ASP code calling an Oracle stored procedure with IN parameters. Code written as shown below:

<%
Dim Cnn
Dim Cmd

Set Cnn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set Cmd = Server.CreateObject(&quot;ADODB.Command&quot;)

Cnn.Open DBCONN
Set Cmd.ActiveConnection = Cnn
Cmd.CommandText = &quot;SP1('&quot; & param1 & &quot;','&quot; & param2 & &quot;',&quot; & param3 & &quot;)&quot;
Cmd.CommandType = adCmdStoredProc
Cmd.Execute
%>

I am encountering the following errors:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Oracle][ODBC Oracle Driver][Oracle OCI]ORA-06550: line 1, column 7: PLS-00201: identifier 'SP1' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored.


As far as stored procedure's code is concerned, it is working properly as I have tested it using TOAD.

What could have been wrong with this? Please help me. Would also appreciate if you can give me helpful links such as documentations, etc.

;-)
 
I already solved the problem. My procedure is placed under user1 account. while my connection in asp is using user2 account. when calling the stored procedure in asp, you should specify the owner of the stored procedure. example:

cnn.execute &quot;user1.storedproc1&quot;

Hope this works for you too.

Many thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top