Re: Problem with procedure definition

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 6 Mar 2003 14:38:38 -0800
Message-ID: <92eeeff0.0303061438.3ef691a4_at_posting.google.com>


"Tom Cat" <homer_simpson_at_libero.it> wrote in message news:<_QH9a.1231$Fc.33305_at_tornado.fastwebnet.it>...
> I'm trying to access Java code directly from Oracle database.
> 1 - I've written the Hello class containing just a static method world()
> which returns a String "world"
>
> 2 - I've loaded in database using the "loadjava" utilities
>
> 3 - I created the HELLOWORLD function in this way:
> SQL> create or replace function HELLOWORLD return VARCHAR2 as language java
> name 'Hello.world() return java.lang.String'; /
>
> 4 - When i try to create the procedure EXAMPLE_JAVA, I obtain an error ...
> SQL> create or replace Procedure EXAMPLE_JAVA as
> begin
> variable mystring VARCHAR2[20];
> call HELLOWORLD() into :mystring;
> print :mystring;
> end;
> /
> warning: procedure created with compilation errors.
> Oracle enterprise console says (I translate from the italian):
> Row number: 3 column number: 10 Error: PLS-00103: Found
> symbol "MYSTRING" instead of one of the following : := .
>
> Thanks in advance for your replies.

First of all, loose the square [] brackets and use () instead.

  1. Change
    > variable mystring VARCHAR2[20];
    to variable mystring VARCHAR2(20);
  2. Change
    > call HELLOWORLD() into :mystring;
    to :mystring := HELLOWORLD;

then try again. BTW, You don't need to put () at the end of a function that does not have any IN or OUT parameters.

Regards
/Rauf Sarwar Received on Thu Mar 06 2003 - 23:38:38 CET

Original text of this message