Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: can't create table in SQL script?
MGokman wrote:
> Your SQL script has PL/SQL block where youre trying to create a table.
> DDL is
> not allowed in PL/SQL.
Not directly...but try this:
CREATE OR REPLACE PROCEDURE sp_ExecuteDDL (sSQL IN VARCHAR2) AS
intCursor INTEGER;
intReturn INTEGER;
BEGIN
intCursor := dbms_sql.open_cursor;
dbms_sql.parse(intCursor, sSQL, dbms_sql.v7);
intReturn := dbms_sql.execute(intCursor);
dbms_sql.close_cursor(intCursor);
END;
/
Where sSQL is any SQL statement that needs to be executed including DDL, DML. mkb Received on Mon Oct 19 1998 - 09:04:36 CDT