xo::db::DB-postgresql instproc 1row (public)
<instance of xo::db::DB-postgresql> 1row [ -dbn dbn ] \ [ -bind bind ] [ -prepare prepare ] qn sql
Defined in /var/www/openacs/packages/xotcl-core/tcl/05-db-procs.tcl
Run a query that must return exactly one row and set its columns as variables in the caller. Raise an error if there is no row.
- Switches:
- -dbn (optional)
- Database name, or empty for the default.
- -bind (optional)
- Bind values for the query.
- -prepare (optional)
- Optional argument types for a prepared statement.
- Parameters:
- qn (required)
- Query name.
- sql (required)
- SQL statement.
- Returns:
- 1 on success.
- Testcases:
- xotcl_core_tutorial_3, test_xo_db_object, test_cr_items, test_prepared_statements
![[i]](/resources/acs-subsite/ZoomIn16.gif)