Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: create procedure error
A copy of this was sent to Norris <johnnie_at_cooper.com.hk>
(if that email address didn't require changing)
On 10 Jun 1999 06:30:21 GMT, you wrote:
>The following statement could be processed sucessfully:
>
>create or replace
>procedure
>/* comment */
>myproc
>as
>begin
>null;
>end;
>
>However, if I put the comment before the procedure, I got error
>
>create or replace
>/* comment */
>procedure
>myproc
>as
>begin
>null;
>end;
>
>I don't know why?
Its a sqlplus'ism. sqlplus is reading your input and trying to figure out what it is you are creating. If it is a proceudre/function/package/etc it will continue reading input until it sees a "/" to run it. If it is not, it will continue reading until it sees a ";" or a "/" and run the block. sqlplus is submitting the block of code only upto the null; statement -- not including the end since you've tricked it into thinking it is *not* creating a procedure by putting the comment there. For example:
SQL> create or replace
2 /* hello */
3 procedure hello
4 as
5 begin
6 null;
Warning: Procedure created with compilation errors.
See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/
Current article is "Fine Grained Access Control", added June 8'th
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA--