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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle 8i + Solaris 8 Procedure Compilation Issue

Re: Oracle 8i + Solaris 8 Procedure Compilation Issue

From: Bob Hairgrove <rhairgroveNO_at_SPAMbigfoot.com>
Date: Sat, 17 Mar 2001 18:28:03 GMT
Message-ID: <3ab38760.21354057@news.webshuttle.ch>

How profound ... ;-)

  1. The "DECLARE" keyword is only used in ad hoc SQL anonymous blocks. Leave it off when creating a stored procedure ... also, you are not declaring anything, so you could even leave it off in an anonymous block.
  2. You need something between "BEGIN" and "END"; if there is nothing, then you need "NULL". This was correct in the second post, however:
  3. You forgot the keyword "AS" in the code you posted the second time.

This should work OK:

SQL> CREATE OR REPLACE PROCEDURE test
 2 AS
 3 BEGIN
 4 -- you could do a PL/SQL version of "Hello World" here:  5 dbms_output.put_line('Hello, world!');  6 END;
 7 /  

 SQL> SET SERVEROUTPUT ON
 SQL> exec test;

On Wed, 14 Feb 2001 15:29:37 +1100, Peter Johnson <peter.johnson_at_galexia.com.au> wrote:

>> >I am wondering if anyone has come across this problem before :-
>> >
>> >SQL> CREATE OR REPLACE PROCEDURE test
>> > 2 AS
>> > 3 DECLARE
>> > 4 BEGIN
>> > 5 END;
>> > 6 /
>> >
>> >Warning: Procedure created with compilation errors.

(...snip...)

>I just tried that but I still get the same error
>
>SQL> CREATE OR REPLACE PROCEDURE test
> 2 BEGIN
> 3 NULL;
> 4 END;
> 5 /
>
>Warning: Procedure created with compilation errors.
>
>Any further ideas ??
>
>
Received on Sat Mar 17 2001 - 12:28:03 CST

Original text of this message

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