Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

dbms_lob.substr

VPrasadSep 11 2018 — edited Sep 12 2018

Select  dbms_lob.substr ('2222Xasff44 2817081 2 0',2,1) as a1,

dbms_lob.getlength('2222Xasff44 2817081 2 0') - (dbms_lob.getlength('2222Xasff44 2817081 2 0') - dbms_lob.getlength(dbms_lob.substr ('2222Xasff44 2817081 2 0',2,1)))  a2,

dbms_lob.substr ('2222Xasff44 2817081 2 0',4,2) as a2

from dual;

give string : '2222Xasff44 2817081 2 0' (Data type is clob: data having 5000 bytes)

Need to display:  2, 222X, asff44 2, 81, 7081 ,2   ,0

by using dbms_lob.substr not with substr or instr

I have tried with above query but not able to write in dynamic, I need to split into 700 columns from the input string.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2018
Added on Sep 11 2018
6 comments
9,914 views