Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: not all variables bound
In article <40f3bf02$0$92613$ed2619ec_at_ptn-nntp-reader02.plus.net>,
info_at_quantarc.co.uk says...
> i posted a message a few days ago with a problem with an out parameter
> in a package procedure i was using to return a recordset via ado to my
> application. i am now trying using a function instead, and this works
> when i pass in all the variables again, but if i leave any out if STILL
> tells me that not all the variables are bound (i kinda understood before
> when the final out parameter hadn't been bound, but with this all the
> variables really seem to me to be bound).
>
> here's the test package i'm trying this with...
>
> --
> -- package TEST
> --
>
> create or replace package TEST as
> type MYCUR is ref cursor;
> function FOO( mynum NUMBER DEFAULT -1 ) return MYCUR;
> end TEST;
> /
>
> create or replace package body TEST as
>
> function FOO ( mynum NUMBER DEFAULT -1 )
> return MYCUR
> is
> myc MYCUR;
> begin
> open myc for
> select * from my_table;
> return myc;
> end FOO;
>
> end TEST;
> /
>
> --
> -- end package TEST
> --
>
> i am calling the function from my application via ado like so...
>
> {call TEST.FOO( ? )}
>
> but this doesn't work. i just get the error "not all variables bound".
> this does however...
>
> {call TEST.FOO( 1 )}
>
> am i not using default variables properly? or can anyone see another
> problem? i have been beating my head against a wall with this problem
Maybe you could post the VB code? Are you binding an input parameter for
the "?", something like this:
Set cmd = New ADODB.Command
With cmd
.CommandText = "{call TEST.FOO( ? )}" .CommandType = adCmdText .Parameters.Append .CreateParameter("mynum", blah....)Set .ActiveConnection = g_conn
Did you see the VB examples for OLE-DB, the one that uses a stored function to return a rowset? It should be just what you need.