sql - How to make a select list from a list of comma-separated values in a table cell in Oracle Apex? -


i have table called products , has following 3 columns: id, name , versions. given row, versions column may have number of versions separated commas. i'm wondering how can create select list in apex application contain in it's lov, each version separated comma?

example, if have following row in products table:

1 | myproduct | 1.0, 1.1, 1.2 

how can create select list in apex application display following lov: '1.0', '1.1' or '1.2'?

sure possible. note select list expects return data in rows, need convert concatenated string rows. using xml this:

select trim(val)    xmltable('/root/e/text()' passing xmltype('<root><e>'   || replace('1.1, 1.2, 1.3, 1.4',',','</e><e>')   || '</e></root>') columns val varchar2(50) path '/' ) 

will return

trim(val) --------- 1.1 1.2 1.3 1.4 

so apply this:

with prd_versions (   select versions products id = :px_product_id ) select trim(val) prd_versions p,   xmltable('/root/e/text()' passing xmltype('<root><e>'   || replace(p.v,',','</e><e>')   || '</e></root>') columns val varchar2(50) path '/' ) 

there of course other ways split string rows, quick google can show you!


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -