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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: what is wrong with this procedure

Re: what is wrong with this procedure

From: Regina Harter <rharter_at_emc-inc.com>
Date: Fri, 01 Jun 2001 14:06:55 -0700
Message-ID: <F001.00318D2F.20010601141840@fatcity.com>

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: Harvinder.Singh_at_MetraTech.com
>
>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: ListGuru_at_fatcity.com (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: rharter_at_emc-inc.com

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: ListGuru_at_fatcity.com (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).
Received on Fri Jun 01 2001 - 16:06:55 CDT

Original text of this message

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