SqlCountStatement — Create a SELECT count(1) statement, use dict for WHERE.
A SQL statement ready to execute that will perform a count.
TableName | Name of table to run query on. |
DictValue | Dict containing column name / column value pairs to use for making the WHERE clause. |
Note that for the dicts, you (currently) must put quotes around any values that will go into text columns or receive an error. We may add support in a future release for automatically detecting the column type and quoting values as necessary.
For information regarding exceptions / errors, see
here.
% RunSqlCreate my_table {id {integer primary key} desc text notes text}
% QQ [SqlInsertStatement my_table {desc 'one' notes 'uno'}]
% QQ [SqlCountStatement my_table {desc 'one'}]
1