Java String parameter in Oracle sql developer -
i have use java function in oracle sql developer. im having troubles java string parameter. know code nothing string. be.
create or replace , compile java source named "stringtest" public class stringtest { public static int test(string a) { return 1; } } / which returns:
java source stringtest created
then:
create or replace function f_string(input1 in char) return number language java name 'stringtest.test(string) return int'; function f_string compiled
now when try execute function:
select f_string("some_text") mytable; ora-00904: "some_text": invalid identifier
- 00000 - "%s: invalid identifier"
when try using single quote instead of " this:
ora-29531: no method test in class stringtest 29531. 00000 - "no method %s in class %s" *cause: attempt made execute non-existent method in java class. *action: adjust call or create specified method.
same thing happens when use varchar2 instead of char. im sure im missing simple, can't find solution few hours , drives me crazy.
when publishing java method in oracle have use full class name. (canonical name).
int - ok , string - not ok.
change
create or replace function f_string(input1 in char) return number language java name 'stringtest.test(string) return int'; to this.
create or replace function f_string(java.lang.string in char) return number language java name 'stringtest.test(java.lang.string) return int';
Comments
Post a Comment