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