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

Re: below procedure executing with errors . Why ?

From: <mjyothi_at_gmail.com>
Date: 15 Feb 2006 09:35:09 -0800
Message-ID: <1140024909.518211.58350@g44g2000cwa.googlegroups.com>


Hello All,

Got it working, just had to remove the '''' quotes from the sqlstmt.

thanks
jyothi

mjyothi_at_gmail.com wrote:
> 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:35:09 CST

Original text of this message

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