Fix compiler warning on Linux ix86
Rewrite two major SQL queries using new bind syntax

Extend bind varargs syntax to handle optionally-NULL parameters.