Jean-Christophe Deschamps wrote:
> There is another good reason why raising an exception would be
> a terrible choice. When SQLite is used as a shared library by some
> scripting language, there is /*no*/ possibility to trap exceptions
> raised within the library.

What the SQL standard calls an "exception" is not necessarily exactly
the same as an exception in other programming languages.  It just means
that the entire SQL command is aborted and has no normal result:

  $ python
  >>> import sqlite3
  >>> sqlite3.connect(':memory:').execute('select * from "no such table"')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  sqlite3.OperationalError: no such table: no such table
  >>>

If SQLite were to change the division-by-zero handling, it could be
reported exactly like most other errors, by returning SQLITE_ERROR from
sqlite3_step().


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

Reply via email to