Oracle PL/SQL and ASP Programs [message #365794] |
Thu, 03 February 2000 19:20 |
Rajeeva
Messages: 20 Registered: October 1998
|
Junior Member |
|
|
I am trying to use a Oracle stored procedure in a ASP (Active Server Page) program. Can some one tell me how to pass in a value using the ASP program and receive the result from the PL/SQL stored proc.
e.g. send in the deptno and get the dname from the dept table.
Thanks in advance
Rajeeva
|
|
|
|
|
|
|
Re: Oracle PL/SQL and ASP Programs [message #365971 is a reply to message #365794] |
Thu, 17 August 2000 08:22 |
Sathish Babu Saravanan
Messages: 2 Registered: August 2000
|
Junior Member |
|
|
Try the following script to execute the stored
procedure
Set OraConn=Server.CreateObject("ADODB.Connection")
OraConn.Open "DSN=Scott;UID=Tiger;PWD=Oracle;"
Set cmdLine= Server.CreateObject("ADODB.Command")
Set cmdLine.ActiveConnection = OraConn
cmdLine.CommandType = adCmdStoredProc
cmdLine.CommandText = "sp_GetDeptName"
Set ParOne=cmdLine.CreateParameter("DeptName",adVarChar,adParamInput,19)
cmdLine.Parameters.Append ParOne
Set ParTwo=cmdLine.CreateParameter("DeptNo",adInteger,adParamOutput,5)
cmdLine.Parameters.Append ParTwo
cmdLine("DeptNo") = CInt("1")
cmdLine.Execute
|
|
|
Re: Oracle PL/SQL and ASP Programs [message #365972 is a reply to message #365794] |
Thu, 17 August 2000 08:31 |
Sathish Babu Saravanan
Messages: 2 Registered: August 2000
|
Junior Member |
|
|
I made a mistake in the previous reply. I apologise for the same.
sp_GetDeptName is the Stored Procedure.
Try the following script to execute the stored
procedure
Set OraConn=Server.CreateObject("ADODB.Connection")
OraConn.Open "DSN=Oracle;UID=Scott;PWD=Tiger;"
Set cmdLine= Server.CreateObject("ADODB.Command")
Set cmdLine.ActiveConnection = OraConn
cmdLine.CommandType = adCmdStoredProc
cmdLine.CommandText = "sp_GetDeptName"
Set ParOne=cmdLine.CreateParameter("DeptName",adVarChar,adParamOutput,19)
cmdLine.Parameters.Append ParOne
Set ParTwo=cmdLine.CreateParameter("DeptNo",adInteger,adParamInput,5)
cmdLine.Parameters.Append ParTwo
cmdLine("DeptNo") = CInt("1")
cmdLine.Execute
|
|
|