Effective way to parse key-value pair.
399318Feb 2 2009 — edited Feb 3 2009Hi,
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.