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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Temporary Tables

Re: Temporary Tables

From: Frédéric Trébuchet <frederic.trebuchet_at_sncf.fr>
Date: 1997/12/19
Message-ID: <01bd0c61$989e15a0$5a02a994@mimp46>#1/1

DDL statements (like create table, drop table, ...) are not allowed in PL/SQL. You have to use dynamic SQL to perform such tasks. Example :

declare
  cur_handle integer ;
  cur_ret integer ;
begin
  cur_handle := dbms_sql.open_cursor ;
  dbms_sql.parse (cur_handle, 'your sql statement or a variable containing it', dbms_sql.v7) ;
  cur_ret := dbms_sql.execute (cur_handle) ;   dbms_sql.close_cursor (cur_handle) ;
end ;

You may have a look to Server Application Developper's Guide

TRF Donald Fuller <drfuller_at_wsicorp.com> a écrit dans l'article <67brvg$183_at_tomcat.admin.navo.hpc.mil>...
> Hi,
> I am unable to create temporary tables in my stored procedures.
> I keep on receiving errors when I use terms Create, Truncate, and Drop.
>
> Error message is as follows:
>
> ORA-06550: line 3, column 1:
> PLS-00103: Encountered the symbol "CREATE" when expecting one of the
> following:
>
> begin declare exit for goto if loop mod null pragma raise
> return select update while <an identifier>
> <a double-quoted delimited-identifier> <a bind variable> <<
> close current delete fetch lock insert open rollback
> savepoint set sql commit <a single-quoted SQL string>
>
> Is it because PL/SQL does not allow these terms ? and if so, how do I get
 

> around it. Any help would be appreciated.
>
> Thanks,
> Don
>
  Received on Fri Dec 19 1997 - 00:00:00 CST

Original text of this message

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