Re: PLS-00103 Encountered the symbol CREATE

From: Tim X <>
Date: Wed, 22 Oct 2008 22:49:52 +1100
Message-ID: <> writes:

> Please help,
> I amd trying to create a script for patching the database.
> the script works with INSERT or SELECT, but when i try to execute a
> package (*pkb). I get an error: "PLS-00103 Encountered the symbol
> CREATE when expecting on of the following: begin ...."

More often than not, this error occurs when you have a syntax error that is confusing PL/SQL. A common cause is a missing ; or , or ) etc.

> The logic is like this

the 'logic' is of no use to us. The code is what matters here.

> varable ...

means what?
> declare ...
> begin
> Select c INTO a FROM test_table
> if :a=:b then
> @PG_TEST.pkb; (if in place of pkb i have simple script with INSERT or
> SELECT there are no problems)

My money is on the above being the problem!

> insert into test_table values((select max(id) from test_table) + 1,
> 'success');
> else
> ...
> end if;
> commit;
> Exception when others then
> rollback work;
> end;
> .
> /
> exit;

The 'code' you provided is obviously not the real code - it is full of incorrect syntax and would never work.

> Please help, What i am doing wrong?

You are doing lots of things wrong.

  1. You have not told us anything about the database or pl/sql version
  2. You ahve not provided real code.
  3. You have not indicated what you have done to try and find the problem
  4. The pseudo code you provided is too poor to tell us anything.
  5. What did show_errors etll you?

consider that the error message is telling you that plsql came across the symbol 'create' (noting that such a symbol doesn't even show up in the pseudo code you posted) when it was expecting something else, such as a begin. This tells you to work backwards from wherever the symbol create is in your code. (does your @script perhaps have a

create or replace package body ....

or something similar. I'm guessing it does. If this is the case, you need to go back to the manuals and start again - the whole concept your trying to get to work is flawed and in too many ways to explain in a NG message. You need to go back to basics as you appear to have some very flawed conceptual model of how sql, pl/sql and sqlplus all fit together.

I'm not trying to be offensive or discourage you, but your a long way off the mark here and I suspect trying to run before you have learnt to walk. Giving you the solution to this problem isn't going to help as your going to encounter a lot more and much more difficult ones because you appear not to have done your homework. I recommend reading the relevant Oracle documentation, such as the PL/SQL reference manual and the Developer's Guide. Don't skip the introductory chapters as these have the basic foundation concepts you appear to be missing. The Oracle Database Concepts Guide would also be a worthwhile read.


tcross (at) rapttech dot com dot au
Received on Wed Oct 22 2008 - 06:49:52 CDT

Original text of this message