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 -> below procedure executing with errors . Why ?

below procedure executing with errors . Why ?

From: <mjyothi_at_gmail.com>
Date: 15 Feb 2006 09:22:04 -0800
Message-ID: <1140024124.011708.232960@g43g2000cwa.googlegroups.com>


Hello,
I have written the following Procedure and i get errors.

DECLARE
cursor c1 is select constraint_name,table_name from user_constraints where table_name ='CRF_DOCUMENT';

       sqlstmt varchar2(1000);
    begin

       for i in c1
       loop
         sqlstmt:=''''||'alter table '||i.table_name||' disable
constraint '||i.constraint_name||' cascade'||'''';
               dbms_output.put_line(sqlstmt);
              EXECUTE IMMEDIATE sqlstmt;
      end loop;

--- 'alter table crf_document disable constraint sys_c001720 cascade';   end;
/

The output of the dbms_output is the statement i commented below. if i execute this statemet independenty in the procedure like execute immediate 'alter table.....' it works fine, but with execute immediate sqlstmt i get an sql error. 'invalid sql statement'

Any help will be appreciated
thank you
Regards
Jyothi Received on Wed Feb 15 2006 - 11:22:04 CST

Original text of this message

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