Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with procedure definition
Your stored procedure is invalid for obvious reasons:
VARIABLE, PRINT and CALL..INTO are SQL*Plus keywords, not PL/SQL keywords. Besides, your variable declaration is incorrect either - you should use VARCHAR2(size), not VARCHAR2[size].
The following should work in SQL*Plus:
SQL> var mystring varchar2(20) SQL> call helloworld into :mystring SQL> print :mystring
or simply
SQL> SELECT helloworld FROM SYS.DUAL;
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "Tom Cat" <homer_simpson_at_libero.it> wrote in message news:7OH9a.1229$Fc.33219_at_tornado.fastwebnet.it...Received on Thu Mar 06 2003 - 10:40:16 CST
> 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.
>
>
![]() |
![]() |