jose isaias cabrera wrote:
> I would like to suggest that once a BEGIN is set, if there is a syntax
> error after a BEGIN, that BEGIN gets deactivated.

This is not how the SQL standard says databases should work.

> sqlite> begin;
> sqlite> select foo FROM;
> Error: near ";": syntax error
> sqlite> begin;
> Error: cannot start a transaction within a transaction

In the command-line tool, it is likely that you now want to type the
correct statement.

In a 'real' program, a syntax error would be very unlikely.  Depending
on the type of error and on the context, the program must decide whether
to roll back the transaction or to continue it, probably by doing
something else.

> Is there a reason why the BEGIN; stays live even though there was
> an error in the SQL command?

An error in the SQL command is not necessarily a fatal error for the
transaction.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to