Hi 'Unit 5',
3) I would like to test the validity of sql statements
before executing them. So I thought I could use "db
complete" command. But now I am not sure what "db
complete" command does. In my tests, it returns 0
(false) regardless of the sql statement. In fact the
only times I have gotton true is if the statement is
empty. The statements are (all are valid and return
data):
% db complete "select 2 * 2 "
% db complete "select a from tab1"
% db complete "select a from tab1 where a < 10"
% db complete "select a from tab1 where a < 10
order by a"
You could take a look at:
http://www.sqlite.org/tclsqlite.html#complete
Basically, it does not validate the syntax, only checks that the SQL statement
is complete (i.e. has a terminating semi-colon).
Regards,
Eugene Wee