Android Question Batch SQL query

Munir Mehta

Member
Licensed User
Longtime User
Sorry this must have been asked before but i couldnt find satisfactory solution

How to run a batch sql commands (or file preferably containing sql queries) without making multiple lines of sql.executenonquery and put different queries everytime in it..

I have 100s of records and i dont want to run it this way.

Kindly redirect me to different thread if already asked..

Thank you..
 

Reviewnow

Active Member
Licensed User
Longtime User
Declare two variables

dim m as map
dim l as list

m.initialize
l.initialize


for each field you want to add
I do not know the source of your data

read from source loop

m.put("dbfield1",yourfield1value)
m.put("dbfield2",yourfield2Value)
m.put("dbfield3",yourfield3Value)
l.add(m)


once you have all the records added to the list use dbutils class

dbutils.insertmaps(sql,"YourTable",l)
 
Upvote 0

Munir Mehta

Member
Licensed User
Longtime User
is there any way to run directly a file... as my friend and i are working separately..
he has created sql files for me to set up database which contains thousands of line.. i can use excel and surround sql commands with m.put or something similar...
But i was looking for some long term solution...Still thanks for the input...
 
Upvote 0
Top