Forums » Toad Extension for Eclipse » Toad Extension for Eclipse

Thread: Compiling JAVA StoredProcedure

This question is not answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 1 - Pages: 1 - Last Post: Dec 15, 2011 4:06 AM by: Lukas Eder
mburger

Posts: 257
Registered: 10/11/10
Compiling JAVA StoredProcedure
Posted: Dec 15, 2011 3:22 AM
 
  Click to reply to this thread Reply

I'm doing this from a SQL Worksheet

CREATE OR REPLACE FUNCTION getJava_property (
jProperty IN VARCHAR2) RETURN VARCHAR2
IS LANGUAGE JAVA name 'java.lang.System.getProperty(java.lang.String) return java.lang.String';

There is no error message popup or error in SQL Recall or in Error Log
but if I do
SELECT getjava_property('java.version') FROM dual;
I get the error
java.sql.Exception:ORA-06575: Package or function GETJAVA_PROPERTY is in an invalid state

and infect on SchemaBrowser the function is invalid

on editing the function from the schema browser I have got the error

PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

;
The symbol ";" was substituted for "end-of-file" to continue.

on editing now the procedure from Stored Procedure Editor the procedure is compiling without an INVALID STATE.

In Toad for Windows compiling the procedure from the SQL Editor works fine ...

what do you thinking about that?


Lukas Eder


Posts: 97
Registered: 2/11/11
Re: Compiling JAVA StoredProcedure
Posted: Dec 15, 2011 4:06 AM   in response to: mburger
 
  Click to reply to this thread Reply

Just add a slash at the end of the function definition...

CREATE OR REPLACE FUNCTION getJava_property (
jProperty IN VARCHAR2) RETURN VARCHAR2
IS LANGUAGE JAVA name 'java.lang.System.getProperty(java.lang.String) return java.lang.String';
/

Then it'll work...



Legend
MVP: 2501 + pts
Guru: 2001 - 2500 pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums