Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Java Store Procedures and PLSQL
Hi,
I've written the following PLSQL program to concatenate the column
TEXT (defined as VARCHAR(4000)) from a table called OBJECTSTORE:
create or replace procedure TEST_PARSE(input_tid in number) is
begin
declare
result varchar2(32767);
cursor object_cur is select TEXT from OBJECTSTORE where TID=input_tid
order by rnumber;
object_row object_cur%ROWTYPE;
begin
open object_cur;
loop
fetch object_cur into object_row;
exit when object_cur%NOTFOUND;
result := result || object_cur.TEXT;
end loop;
close object_cur;
result := PARSE(result);
end
The PARSE function is linked to a Java store procedure which accept a
String as input and return a String.
If the SELECT in the program returns only 1 row everything works
perfectly, but if for example it returns 3 records then the
concatenation seems to work fine, but the PARSE function fails.
The java sotre procedure is defined as follow:
create or replace function PARSE(input in varchar2) RETURN varchar2
as language java
name 'Base64.decodeToString(java.lang.String) return String';
Is it correct to map a String to a VARCHAR2?
What else could be the problem?
Many thanks,
G.
Received on Mon Jan 29 2007 - 15:29:20 CST