Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
multi select dropdown values into db
getnaren
[html]
I need to insert / update multiselect dropdown (area_id) values into oracle db.
table has
prime_id , area_id
I need to have multi rows for the area_id with the same prime_id ..if the area_id has more than one selected area_id.
in dcr area_id looks like this
1,2,3,4
and in the db I need
prime_id area_cd
1 1
1 2
1 3
1 4
how can I get this using perl and sql
[/html]
Find more posts tagged with
Comments
Migrateduser
First of all, I'd store your value as (primeid)-(areaid) because you need both values. So, your HTML might look something like:
[HTML]
Area 1
Area 2
[/HTML]
... and so on. In Perl, or whatever you have processing this form, it should be easy enough to split these values. You would have something that looks like:
1-1,1-3,1-4,1-5
First, split the string by comma to get each item selected. Then, split each item by hyphen to get the primeid and areaid pair.