Array to populate Database

serigne
serigne used Ask the Experts™
on
How can I use the result off a One-Dimensional Array  to populate a Database, each value will have each own row.

Sample :22,25,32,35,50

Field          Field2
1             22
2             25  
3
4
5
6            50
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
myvar="22,25,32,35,50"

ssql = "select * from mytable where my column in (" & myvar & ")"


Typo

myvar="22,25,32,35,50"

ssql = "select * from mytable where mycolumn in (" & myvar & ")"

Author

Commented:
This will just populate one row, I would like to split the data, with each data having a new row.
Why woudl it populate one row ? If you have those values in separate rows (which I assume) then it would populate multiple rows

Please confirm
Are you trying to insert the values from an array into a table?  Or you are trying to run a select query?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial