Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Create Table in PL/SQL

Re: Create Table in PL/SQL

From: Nathan D. Hughes <nhughes_at_well.com>
Date: 1997/12/19
Message-ID: <67ed3p$82f$1@was.hooked.net>#1/1

drfuller_at_wsicorp.com (Donald Fuller) writes:

> I am trying to create temporary tables in my stored procedures and I
>am finding that I cannot create, drop or truncate tables. Is this
>functionality not available in PL/SQL?
 

>Any suggestion on how I can ? I listed the error message I am receiving.

To perform DDL operations in PL/SQL, you must use the dbms_sql package. Check the manual for usage. The example below will create a test table using dbms_sql.

declare
  handle integer;
  sql_stmt varchar2(142);
begin
  handle := dbms_sql.open_cursor;
  sql_stmt := 'create table test (a1 number) tablespace user_data';   dbms_sql.parse(handle, sql_stmt, dbms_sql.native);   dbms_sql.close_cursor(handle);
end;
/

--

Nathan D. Hughes <nhughes_at_well.com>
Computer Consultants of America, Inc.
Received on Fri Dec 19 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US