Jump to content

oracle sql help ?


bandababu

Recommended Posts

two strings madhya lo unna text motham extract cheyyali ?

CLOB column lo text ila unda

 

A boy gains 10 lbs in 2 years while his friends gained only 

5 lbs . He ate 400-500 calories of food in every meal.

 

while and meal madhya lo unna text motham kavali ? substr and instr functions tho ela rayali ?

 

column lo data vary avuthundi. so positions consistent ga undadu

Link to comment
Share on other sites

First, you need convert CLOB to varchar with DBMS_LOB.SUBSTR function

 

SUBSTR(varchar_string, INSTR(varchar_string,'while')+5, INSTR(varchar_string,'meal'))

This works in Oracle.

Link to comment
Share on other sites

Just found in google, you can directly use DBMS_LOB.SUBSTR and DBMS_LOB.INSTR functions directly on CLOB's.

Try like below:

DBMS_LOB.SUBSTR(CLOB_FIELD,DBMS_LOG.INSTR(CLOB_FIELD,'while')+5,DBMS_LOB.INSTR(CLOB_FIELD,'meal'))

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...