A transaction is a way to make a group of things that happens atomic,
but an SQL statement that generates an error doesn't really make
anything happen, so it has no impact on the transaction itself or any of
the other actions within it.  That kinda the whole point, in a way - one
statement failing doesn't make the other immediately invalid.  The
decision to roll back the entire transaction when any statement within
it fails is a user or developer decision, however, not a function of
transactions - you can roll it back, invalidating the other actions, or
you can fix it and re-execute it, leaving the other actions intact.

   This isn't an SQLite thing either... All databases work this way, as
far as I'm aware.

   -Tom

> -----Original Message-----
> From: Vladimir Zelinski [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 12, 2005 11:26 AM
> To: sqlite-users@sqlite.org; Jay Sprenkle
> Subject: Re: [sqlite] Does sqlite really support transaction?
> 
> Here is the problem. My external program builds sql
> script and places into file my_script.sql
> Then I execute statement "sqlite3 my_db <
> my_script.sql" as a system call from my external
> program. I can check result of execution this
> statement and it always returns 0 (success) regardless
> of actual SQL result. I have absolutely no knowledge
> of my SQL execution status.
> 
> Vladimir
> --- Jay Sprenkle <[EMAIL PROTECTED]> wrote:
> > On 5/12/05, Vladimir Zelinski <[EMAIL PROTECTED]>
> > wrote:
> > > I understand that. Question is HOW I can check if
> > > statement failed or successful? What variable
> > contains
> > > status of the result of execution.
> > 
> > The return code from the call that executes it.
> > Are you running SQL via code or from the command
> > line interpreter?
> > 
> 

Reply via email to