|
 |
asp_databases thread: retrieve ADO recordset from Oracle stored procedure
Message #1 by Chao Zhou <ChaoZhou@e...> on Mon, 23 Oct 2000 09:44:13 -0400
|
|
Hi All,
I failed to retrieved recordset from an oracle stored procedure which with 2
input parameters and return a cursor.
The SP is something like:
CREATE OR REPLACE PACKAGE BODY pk1
IS
FUNCTION f1(p1 IN VARCHAR(8), p2 IN VARCHAR(8))
RETURN availjobs
IS
avail_jobs_cur availjobs;
BEGIN
OPEN avail_jobs_cur FOR
SELECT
...
END
RETURN avail_jobs_cur;
END f1;
I used OLEDB for oracle in my ASP
...
set oComm = Server.CreateObject("ADODB.Command")
with oComm
set ActiveConnection = oConn
.CommandText = ?
.CommandType = adCmdText
.Parameters.Append .CreateParameter("p1", adVarChar,
adParamInput, 8, "string1")
.Parameters.Append .CreateParameter("p2", adVarChar,
adParamInput, 8, "string2")
end with
set oRst = oComm.Execute
What's the correct format I should use for CommandText?
Thanks,
Chao Zhou
Message #2 by Nisha Nambiar <nishanam@y...> on Mon, 23 Oct 2000 09:45:07 -0700 (PDT)
|
|
Chao
I have never used Oracle but have written Stored
procedure in SQL SERVER and this what I would do in
that
with oComm
set ActiveConnection = oConn
.CommandText = "pk1" ('the name of the Procedure)
.CommandType = adCmdStoredProc or 4
You can try this if this works with Oracle.
Nisha
--- Chao Zhou <ChaoZhou@e...> wrote:
> Hi All,
>
>
> I failed to retrieved recordset from an oracle
> stored procedure which with 2
> input parameters and return a cursor.
>
> The SP is something like:
>
> CREATE OR REPLACE PACKAGE BODY pk1
> IS
>
> FUNCTION f1(p1 IN VARCHAR(8), p2 IN VARCHAR(8))
> RETURN availjobs
> IS
> avail_jobs_cur availjobs;
>
> BEGIN
> OPEN avail_jobs_cur FOR
> SELECT
> ...
>
> END
> RETURN avail_jobs_cur;
> END f1;
>
>
> I used OLEDB for oracle in my ASP
>
> ...
> set oComm = Server.CreateObject("ADODB.Command")
>
> with oComm
> set ActiveConnection = oConn
> .CommandText = ?
> .CommandType = adCmdText
>
> .Parameters.Append .CreateParameter("p1",
> adVarChar,
> adParamInput, 8, "string1")
> .Parameters.Append .CreateParameter("p2",
> adVarChar,
> adParamInput, 8, "string2")
> end with
>
> set oRst = oComm.Execute
>
> What's the correct format I should use for
> CommandText?
>
>
> Thanks,
>
>
> Chao Zhou
>
|
|
 |