Android Question How to insert multiple records in batch in remote database.

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Sorex,

Can you please tell me how do i use multiple insert statements in one job.

str1="Insert into mytable values(1,2,3,4)"
str2="Insert into mytable values(1,2,3,4)"
str3="Insert into mytable values(1,2,3,4)"
str4="Insert into mytable values(1,2,3,4)"
str5="Insert into mytable values(1,2,3,4)"
...
...
100 records

Job_Insert_Values.Initialize("Job_Insert_Values",Me)

Job_Insert_Values.Download2(URL,Array As ???????????)
or
Job_Insert_Values.PostString(URL,Array As ???????????)

Thanks
Juzer
 

sorex

Expert
Licensed User
Longtime User
don't send queries but only your values.

use something like

data="data=1,2,3,4|1,2,3,4|1,2,3,4"

instead and on the PHP/ASP/whatever you split it up based on the | and then on the ,

you'll need to use POST and GET is limited in size.
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Thanks Sorex,

You mean all string management, I will try this with Download2 i guess as Poststring gives ModSecurity Error on my server

Juzer
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Thanks Erel,
I always wanted to use RDC but could not figure out what all is needed to be downloaded to use it.
If you can please tell me i will still try.
Juzer
 
Upvote 0

JTmartins

Active Member
Licensed User
Longtime User
Hi Juzer.

You can "build" your string in a way that allows you to send everything in a single sql comand and that will make it easy to use httpUtils.

Thats the way I use and works like a charm.

Example :

INSERT INTO tableCapitals (city,country) values ('Lisbon','Portugal'),('Paris ','France'),('London','United Kingdom'),('Berlim','Germany')....

In other words, there is no need to send 20 calls to the webserver, when you can do it all in one go.

All the best
 
Upvote 0
Top