Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Temporary Tables
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