Top | Previous | Next |
system.db.runScalarPrepQuery |
Description Runs a prepared statement against a database connection just like the runPrepQuery function, but only returns the value from the first row and column. If no results are returned from the query, the special value None is returned.
Syntax system.db.runScalarPrepQuery(query, args, database, tx) Parameters String query - A SQL query (typically a SELECT) to run as a prepared statement with placeholders (?) denoting where the arguments go, that should be designed to return one row and one column. Object[] args - A list of arguments. Will be used in order to match each placeholder (?) found in the query. String database - The name of the database connection to execute against. If omitted or "", the project's default database connection will be used. String tx - A transaction identifier. If omitted, the query will be executed in its own transaction. Returns Object - The value from the first row and first column of the results. Returns None if no rows were returned. Scope All |