Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: SQLite compound INSERT  (Read 11511 times)
eball
Jr. Member
**
Posts: 15


View Profile Email
« on: April 20, 2009, 07:31:29 »

Has anyone been successful at using compound INSERTS with SQLite.
Just cant get it work.

I tried a single long query with multiple INSERT tags, but cant get that to work when coming from AS3. If i copy the long query straight into SQLite Admin and run the query there, it works perfect.

Right now i have to loop thru each insert with a new sql class and connection per one.
Unfortunately, after about 430 records, it stops.

All my other SQLite tags are working fine (single INSERT, DELETE, CREATE, SELECT, etc)
Any help would be greatly appreciated.
Logged
Ondina
Sr. Member
****
Posts: 86


View Profile Email
« Reply #1 on: April 21, 2009, 12:23:56 »

My first thought about your question was: why don't you use transactions?

My guess is that your SQLite Admin (which one are you using?) is grouping your statements  into a  transaction.
It probably makes an array out of your statements and loops through them inside a transaction.
That's probably why your “long query” works in there.

If you simply add a statement after another and try to execute() them all together it wont work, because, as far as I know, only one statement is executed at a time. I would suggest you use transactions.

Right now i have to loop thru each insert with a new sql class and connection per one.
Unfortunately, after about 430 records, it stops.

Can you say more about this?  Are you inserting the records into the same table, or are there different tables? Were you using asynchronous or synchronous connections?

Ondina
Logged

~ Ondina ~
eball
Jr. Member
**
Posts: 15


View Profile Email
« Reply #2 on: April 21, 2009, 02:24:56 »

I tried Transactions last night but was doing it wrong.
Per your suggestion, I tried it again and got it work.
Thanks a bunch.
Logged
Pages: [1]
Print