Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql - help!!
CREATE TABLE statements and likes belong to DDL statements. You cannot use a DDL statement in your PL/SQL procedures and functions directly. If you are using PL/SQL version 2.0 or higher, you can use DBMS_SQL package to do this. And it is the same for the dynamic SQL statements. Good luck.
Dan
Goldrich wrote:
>
> Can't find the answer to this one in any documentation or books I have.
>
> How do I issue a create table stmt w/in a PL/SQL block in a stored proc
> implementation. The syntax for my create table is fine-- it goes
> smoothly when entered at SQLPLUS command line. Same command w/in stored
> proc produces a syntax error.
>
> 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>
> <a single-quoted SQL string> << close delete fetch lock
> insert open rollback savepoint set sql commit
>
> Email replies would be greatly appreciated as I am posting this via a
> very unreliable new server.
>
> Thanks in advance.
Received on Thu Jan 30 1997 - 00:00:00 CST