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!

Effective way to parse key-value pair.

399318Feb 2 2009 — edited Feb 3 2009
Hi,

I've a PL/SQL process, in which I've lot of dynamic sql routines planned, to parse input data to a procedure.

One of the parameter to call or that'd be passed to this procedure is a "key-value pair"
e.g.
procedure p ( id in number, state_name in varchar2 )
Values could be
20, 'vc1=AZ, vc2=WA, vc3=NY, vc4=NJ'
...

My requirement is as follows
<ol><li>Parse 'state_name', for values of state ( AZ, WA, NY, NJ ) - note that the list could be of variable length</li>
<li>I'm not interested in 'key' per se ( vc1, vc2, vc3... )</li>
<li>State names are important as ( as ) part of the process, I want to concatenate them to form tables-name,
which (already) exists e.g. table_CA, table_AZ, table_WA, table_NJ - so basically I need to
parse these names and have them in a way to be able to use them as part of other dynamic SQL's.
</li>
</ol>
Please advice.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 3 2009
Added on Feb 2 2009
6 comments
2,268 views