Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: create procedure error

Re: create procedure error

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 10 Jun 1999 12:11:51 GMT
Message-ID: <3765ab11.4221009@newshost.us.oracle.com>


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
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jun 10 1999 - 07:11:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US