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

Home -> Community -> Usenet -> c.d.o.server -> Re: 40 Error Text = PLS-00201: identifier 'TABLE_NAME' must be declared

Re: 40 Error Text = PLS-00201: identifier 'TABLE_NAME' must be declared

From: spencer <spencerp_at_swbell.net>
Date: Tue, 12 Sep 2000 23:00:50 -0500
Message-ID: <8ZCv5.5408$q13.113522@nnrp3.sbc.net>

This same question has been answered numerous times in this newsgroup... but here it is again. PL/SQL is expecting the name of an object (table,view, synonym,etc) in the SELECT statement. You are getting the error message because Oracle cannot find an object of the given name.

In order to execute a statement where the SQL statement is not defined at compile time, you will need to use the DBMS_SQL package, which allows you to prepare and execute "dynamic" SQL.

Note: In addition to the DBMS_SQL package supported in earlier versions, Oracle 8.1.6 provides a new, more concise syntax for executing dynamic SQL.

HTH <1517westmore_at_my-deja.com> wrote in message news:8pmfr5$riq$1_at_nnrp1.deja.com...
> ok im a newbie here so bear with me :)
>
> im trying to create a procedure to automate trigger/sequence creation.
> so far here is my code
> ----
> procedure create_trigger
> ( table_name IN varchar2 )
> IS
> max_id_num number;
> begin
> dbms_output.put_line('*** begining trigger creation');
> select max(id) into max_id_num from table_name;
> /* max_id_num := select max(id) from table_name; */
> end;
>
> ---
>
> error that oracle spits back at me
>
> Line # = 6 Column # = 40 Error Text = PLS-00201: identifier 'TABLE_NAME'
> must be declared
> Line # = 6 Column # = 4 Error Text = PL/SQL: SQL Statement ignored
>
> im doing it exactly like pl/sql book says and i thought i _was_
> declaring it at the top.
>
> any light that anyone could shed would be very helpful.
>
> thanks
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Received on Tue Sep 12 2000 - 23:00:50 CDT

Original text of this message

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