Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: below procedure executing with errors . Why ?
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