Well, for one thing, I think you need to use dynamic sql (the DBMS_SQL 
package) to use a variable as a table name.

At 01:17 PM 6/1/01 -0800, you wrote:
>create or replace procedure remove_bucket
>as
>cursor c1 is
>select table_name from (
>select table_name from user_constraints
>where r_constraint_name ='PK_T_ACC_USAGE_1');
>temp_name varchar2(255);
>temp_count number(10);
>str varchar2(2000);
>begin
>open c1;
>loop
>fetch c1 into temp_name;
>exit when c1%notfound;
>select count(*) into temp_count from temp_name;
>dbms_output.put_line(temp_count);
>end loop;
>close c1;
>EXCEPTION
>WHEN OTHERS
>THEN DBMS_OUTPUT.PUT_LINE('INVALID SYNTAX');
>end;
>/
>
>I am geeting following error:
>
>15/1     PL/SQL: SQL Statement ignored
>15/38    PLS-00201: identifier 'TEMP_NAME' must be declared
>
>what is the possible solution...
>
>Thanks
>Harvinder
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Harvinder Singh
>   INET: [EMAIL PROTECTED]
>
>Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
>San Diego, California        -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from).  You may
>also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Regina Harter
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to