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!

How to Split the string using Substr and instr using loop condition

user627525Dec 15 2011 — edited Dec 16 2011
Hi every body,

I have below requirement.

I need to split the string and append with single quotes('') followed by , (comma) and reassign entire values into another variable. so that i can use it where clause of update statement

for example I am reciveing value as follows

ALN varchar2(2000):=(12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434);

Note: In the above variable i see 8 transactions, where as in real scenario i donot how many transaction i may recive.

after modification i need above transactions should in below format

ALTR Varchar2(2000):=('12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434');

kindly help how to use substr and instr in normal loop or for loop or while loop while modifying the above transactions.

Please help me to sort out this issue.


Many Thanks.

Edited by: user627525 on Dec 15, 2011 11:49 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2012
Added on Dec 15 2011
3 comments
2,858 views