PLS-00103: Encountered the symbol “CREATE” when expecting

PLS-00103: Encountered the symbol “CREATE” when expecting

If you want to use DDL statement in PL/SQL Blocks then you can do not write directly DDL Statement.
You have to use the Dynamic SQL Syntax for executing the DDL Statement.


SQL> begin
2 create table test_bkp1 (id number);
3 end
4 /
create table test_bkp1 (id number);
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
( begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
continue close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe purge

Donot use DDL directly in PL/SQL blocks. Use the DDL Statements with Dynamic SQL as follows.

EXECUTE IMMEDIATE 'create table TEST_BKP1 (id number, column_value varchar2(100))';

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.