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!

substr and instr for variables assginement in a csv file

978485May 10 2013 — edited May 10 2013
Hi gurus

Belows is my input csv file like with no fixedl enght

vinput_file:

WESTERN SAHARA,Moroccan Dirham,MAD,504,2,
YEMEN,Yemeni Rial,YER,886,2,
ZAMBIA,Zambian Kwacha,ZMW,967,2,
ZIMBABWE,Zimbabwe Dollar,ZWL,932,2,

and i want to assign 3 letter alphabetical to DESC and the 3 digit numerical to CODE


CODE := SUBSTR(vinput_rec,1,INSTR(vinput_file,',',1,1)-1);
DESC := SUBSTR(vinput_rec, INSTR(vinput_file,',',1,1)+1);

can anyone help me please with the above kindly
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2013
Added on May 10 2013
2 comments
392 views