Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting Clob fields

Status
Not open for further replies.

kizziebutler

Programmer
Apr 28, 2005
81
GB
I thought I would ask the experts a question first. I have some data that I need to extract on a daily basis from cron tab. I am spooling this data out to a "|" file, file.csv, but I am having problems with the clob field. Some of my Oracle DBA colleagues have mentioned packages such as dbms_lob to handle the clob field. Any suggestions!!

 
kizzie,

Because you have mentioned a 'cron tab' I presume that you are running some flavour of UNIX, and are trying to automatically produce extracted data in a CSV file on a regular and frequent basis.

DBMS_LOB is the only way to put data in and out of a CLOB (obviously by their very nature, this excludes BFILES - they're external to the database, so it is possible to alter them externally). You can access a LOB from either SQL or PL/SQL.

As you may already be aware, DBMS_LOB has both INSTR and SUBSTR functions, which I recommend you use to chop the LOB up into small enough sections to populate your csv file. That way you won't get lines thousands of characters in length.

I also recommend the O'Reilly book "Oracle Built-In Packages" which has an excellent section on the care and feeding of LOBS.

You can get some immediate info from
I hope this helps you along. Let me know how you get on with this.

Regards

Tharg

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top