Pete2003
asked on
Java Function in Oracle function
Hi guys,
I have a rather urgent problem.
I have a java function which is called inside an oracle (11g r2) procedure.
Now there is a problem inside that java function. I think I have fixed the java code but now to test it.
The definition of that function is myfunc(inClob CLOB, outBlob BLOB);
Now my problem is that while I have some knowledgeof Java and a bit of SQL combining and testing it is a bit ourside my scope and I do not have access to the oracle calling code so I can not run anything there.
As far as I understand it the inClob contains some simple text and the outBlob contains the modified data.
The modified data will be written to a file.
What I now need help isis either some example SQL code of how to save that modified java code into the database and how to call it so that it writes out a file or if that is too complex then how do I texst the clob and blob parameters inside java as they are both just interfaces and the serialblob is also not helping.
Any suggestions or ideas are greately appreciated.
Thanks
I have a rather urgent problem.
I have a java function which is called inside an oracle (11g r2) procedure.
Now there is a problem inside that java function. I think I have fixed the java code but now to test it.
The definition of that function is myfunc(inClob CLOB, outBlob BLOB);
Now my problem is that while I have some knowledgeof Java and a bit of SQL combining and testing it is a bit ourside my scope and I do not have access to the oracle calling code so I can not run anything there.
As far as I understand it the inClob contains some simple text and the outBlob contains the modified data.
The modified data will be written to a file.
What I now need help isis either some example SQL code of how to save that modified java code into the database and how to call it so that it writes out a file or if that is too complex then how do I texst the clob and blob parameters inside java as they are both just interfaces and the serialblob is also not helping.
Any suggestions or ideas are greately appreciated.
Thanks
I am not sure that this is very close to waht you plan to do - it is not obvious
that they are talking about java stored procedures here, but they have
lots of java code examples about rreading and writing Clobs and Blobs - perhaps
this could help:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6379798216275
ASKER
Hi thanks for the reply.
So now with that can I just use a get_line to read a text file into a clob and put_raw to write the contents of the blob ?
So now with that can I just use a get_line to read a text file into a clob and put_raw to write the contents of the blob ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
blob's are binary large objects.
to write a file use UTL_FILE package, valid for text data.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm
Here you may find some samples...
Hope it will help! :) Cheers,