Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> EXECUTE IMMEDIATE IN ORACE 9i
HI,
Can anyone help?
I'm using SQL/PLUS from ORACLE 9i to test out some SQL. Here's the code:
BEGIN
FOR r IN (SELECT 1 FROM all_tables WHERE table_name = 'ADDRESS')
LOOP
EXECUTE IMMEDIATE 'DROP TABLE ADDRESS'
END LOOP;
END;
But it returns the following error:
EXECUTE IMMEDIATE 'DROP TABLE ADDRESS';
*
ERROR at line 4:
ORA-06550: line 4, column 13:
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "IMMEDIATE" to continue.
I thought that the EXECUTE IMMEDIATE could handel a DDL Statement?
Any help
Cheers Nick Received on Fri Apr 11 2003 - 07:53:56 CDT