Java external procedure parameters [message #273515] |
Wed, 10 October 2007 14:21 |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Hi, I'm calling a Java External Procedure like this:
CREATE FUNCTION HAS_GROUP (STRGROUP IN VARCHAR2)
RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'PKGPORTAL.GROUPS.HAS_GROUP
(java.lang.String) return java.lang.String';
/
The thing is that I need also to send it the CLIENT_IDENTIFIER, but I saw in every example that the parameters that the PLSQL function recieves are the same that you send to Java. Am I able to send an extra parameter to Java?. I need it to recieve the CLIENT_IDENTIFIER. Thank you.
|
|
|
|
Re: Java external procedure parameters [message #273534 is a reply to message #273515] |
Wed, 10 October 2007 14:55 |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Hi,
I'm sorry, but I don't understand. Could you explain me?. Should I create a function that returns the client_identifier and from Java make a callback to it?.
Aren't I able to do something like this?.
v_client_id VARCHAR2 (256):= UPPER (TRIM (SYS_CONTEXT ('userenv', 'client_identifier')));
And send it to Java as a parameter in the calling statement(NAME 'PKGPORTAL.GROUPS.HAS_GROUP(java.lang.String) return java.lang.String')?.
Thanks for answering so fast.
|
|
|
|
Re: Java external procedure parameters [message #273769 is a reply to message #273515] |
Thu, 11 October 2007 11:02 |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Thanks!, I'll try that way. One of my Java's returns a Vector, and I'm creating this type for it:
type role_type is table of varchar2(100) index by binary_integer;
And calling it this way:
FUNCTION get_role (client_id IN VARCHAR2)
RETURN role_type
AS
LANGUAGE JAVA
NAME 'PortalJava.Pkgfuncldap.Get_Role.Client_Roles(java.lang.String) return java.util.Vector';
But it doesn't compile. Am I stablishing a wrong match between Java vectors and the database table?.
|
|
|
|
|
|