Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Java Store Procedures and PLSQL

Java Store Procedures and PLSQL

From: Geppo <gepporello_at_eircom.net>
Date: 29 Jan 2007 13:29:20 -0800
Message-ID: <1170106160.122493.324510@v45g2000cwv.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US