Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Q: DBMS_SQL and select count(*) into :x - error ORA-01006

Q: DBMS_SQL and select count(*) into :x - error ORA-01006

From: Osipov N.F. <nfo_at_yamb.ygaz.tyumen.su>
Date: 1997/11/29
Message-ID: <ABuOsVqGVI@yamb.ygaz.tyumen.su>#1/1

Hi!

I ask you to help, if there will be a time.

In the documentation:
Oracle7 Server Application Developer's Guide, chapter 10 Using Dinamic SQL I did not manage to find the answer for the decision of a task.

It is necessary to create a procedure for definition of quantity of records in different tables.
In these tables is identical column - date _ rec (date)

With run of a procedure recno_tab there is a error ORA-01006 Bind variable does not exist

Prompt, please, in what here error?

create or replace procedure recno_tab
( tname in varchar2, date_a in date, n_row out number) as

 i number;
 x number;
 n number;

 cmd varchar2 (200);
begin
 i: = dbms_sql.open_cursor;
 cmd: ='select count (*) into :x from '||table_name||

       ' where date_rec='||date_a||";
 dbms_sql.parse (i, cmd, dbms_sql.v7);
 dbms_sql.bind_variable (i, ':x', n);
 x: = dbms _ s(i))
 dbms_sql.close_cursor(i))
 n_row: = n;
end;

Very much I ask to answer on e-mail.

Yours faithfully, Nikolai Osipov
Yamburg Tyumen Russia
nfo_at_yamb.ygaz.tyumen.su Received on Sat Nov 29 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US