Home » SQL & PL/SQL » SQL & PL/SQL » Read CLOB column (Oracle 10.2.0.4.0)
Read CLOB column [message #572995] Wed, 19 December 2012 06:05 Go to next message
subhash.pophale
Messages: 9
Registered: December 2007
Location: Mumbai
Junior Member
I have two tables File_Master and File_Detail
File_Master Primary key FILE_ID
File_Detail Primary key FILE_ID,LINE_ID

I have a CLOB column FILE_CONTENT in table File_Master.
For every FILE_ID record in File_Master, several hundreds of lines are stored in the CLOB column.

I want to read this CLOB column 'File_Content' and and break every line (1000 Characters)
piecewise to populate columns of File_Detail.

Since there will be thousands of lines to process, what would be the best approach in writing PL/SQL code for better performance?

Thanks in advance.
Re: Read CLOB column [message #572996 is a reply to message #572995] Wed, 19 December 2012 06:12 Go to previous message
Michel Cadot
Messages: 58945
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is only one way: loop on every 1000 characters using SUBSTR.
(There are other ways but they require knowing how Oracle manages its memory and a couple of mathematical algorithms.)

Regards
Michel
Previous Topic: Replace Reapiting the Same Description with -DO-
Next Topic: inserting records into target table from three source tables
Goto Forum:
  


Current Time: Mon Sep 01 03:44:14 CDT 2014

Total time taken to generate the page: 0.09191 seconds