Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Retry value from Oracle stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-15 : 13:08:12
Ivan writes "How can I read return value from Oracle stored procedure

---------------------------------------------------------
procedure like this one:

CREATE OR REPLACE PROCEDURE proc(in_par1 IN NUMBER, out_par2 OUT NUMBER) IS
CURSOR c1(in_val NUMBER) IS
SELECT count(*) cnt FROM table1 WHERE field1 = in_val
BEGIN
IF NOT c1%ISOPEN THEN
OPEN c1(in_par1);
END IF;
LOOP
FETCH c1 INTO out_par2;
EXIT WHEN c1%NOTFOUND;
END LOOP;
CLOSE c1;
END proc;
/
show errors;
------------------------------------------------------------
And ASP (VB Script) like this one:

Response.Write("")
Response.Write("")

set Rs1 = Server.CreateObject("ADODB.Recordset")
set Cmd = Server.CreateObject("ADODB.Command")

Set Cmd.ActiveConnection = Db
Cmd.CommandText = "proc"
Cmd.CommandType = adCmdStoredProc

Set prm = Cmd.CreateParameter(in_par1, adInteger, adParamInput , 0, 2)
Cmd.Parameters.Append prm


Set prm = Cmd.CreateParameter(out_par2, adInteger, adParamOutput , 0, 2)
Cmd.Parameters.Append prm

Set Rs1 = Cmd.Execute
Rs1.MoveFirst ' ------ At this point script return ERROR -----

Response.Write(Rs1(0))

Set Rs1 = Nothing
Set Cmd = Nothing
Set Db = Nothing

Response.Write("")"
   

- Advertisement -