Re: can't create table in SQL script?

From: M. Bhatti <mohammed.bhatti_at_mci.com>
Date: 1998/10/19
Message-ID: <362B46F4.460AA443_at_mci.com>#1/1


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 - 00:00:00 CEST

Original text of this message