Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01007 when executing DBMS_SQL.COLUMN_VALUE
Haresh,
You must first call
DBMS_SQL.DEFINE_COLUMN(cursor_var, col_num, receiving_var);
for each column before the DBMS_SQL.EXECUTE(cursor);
Regards
Haresh Assumal wrote:
> Hi,
> I am trying to get a count(*) of rows in using the following query in a
> PL/SQL function:
>
> DBMS_SQL.PARSE
> (cursor_handle,
> 'SELECT count(*) FROM ' || table_name ||
> ' WHERE ID = ' || object_id ,
> DBMS_SQL.V7);
> execute_feedback := DBMS_SQL.EXECUTE(cursor_handle);
>
> Note: table_name and object_id are PL/SQL variables.
> I get an error here when I try and do:
>
> DBMS_SQL.COLUMN_VALUE(cursor_handle,1,num_ids);
>
> Where num_ids is declared as number. The error is:
>
> ORA-01007: variable not in select list
>
> Why do I get this? Any help would be much appreciated.
> Thanks,
> Haresh
> E-mail:assumal_at_sprynet.com
-- ************************* Gary Smith CERN, Geneva, Switzerland Email: Gary.Smith_at_cern.ch Tel: +41 22 7678944 *************************Received on Fri Oct 31 1997 - 00:00:00 CST
![]() |
![]() |