Transaction for single SQL query?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Transaction for single SQL query?

Brown, Dave

Is there any benefit in a C program to wrapping a single insert via
sqlite3_exec() in a transaction?
In other words, is

INSERT INTO table1 VALUES(1,2);

any worse (or better) than doing:

BEGIN;
INSERT INTO table1 VALUES(1,2);
COMMIT;

Thanks,

Dave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transaction for single SQL query?

Cory Nelson
no, as all queries that aren't in a transaction act as a single
transaction themselves.

On 5/22/05, Brown, Dave <[hidden email]> wrote:

>
> Is there any benefit in a C program to wrapping a single insert via
> sqlite3_exec() in a transaction?
> In other words, is
>
> INSERT INTO table1 VALUES(1,2);
>
> any worse (or better) than doing:
>
> BEGIN;
> INSERT INTO table1 VALUES(1,2);
> COMMIT;
>
> Thanks,
>
> Dave
>


--
Cory Nelson
http://www.int64.org
Loading...