Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Java Function in Oracle function

Posted on 2011-10-17
4
Medium Priority
?
457 Views
Last Modified: 2012-08-14
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


0
Comment
Question by:Pete2003
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Javier Morales
ID: 36982463
clob's are Character large objects.
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,
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36982687

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
0
 

Author Comment

by:Pete2003
ID: 36982730
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 ?
0
 
LVL 7

Accepted Solution

by:
Javier Morales earned 2000 total points
ID: 36984249
Yes, it should work.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question