This token processor adds an easy way to pass parameters to SQL queries. It also
automatically imports the SQL classes ("io/sql/connection"
) and
enables support for the transaction
statement.
The SQL string literals can be split into multiple lines using the +
operator.
Use the ParamString class for more complex concatenations. You
can disable the SQL string literals by wrapping the literal in parenthesis.
use "io/sql"; use "classes"; function test(sql: SQLConnection, id: Integer) { transaction (sql) { var rs = sql.query("SELECT * FROM test WHERE id=?", id); while (rs.next()) { log("got "+rs.get_string("text_field")); } rs.close(); } }