
Statement manages a statement prepared for a database connection.
Refer to the Sql docs for more details.
Slots
- close
-
Void close()
Close the statement.
- conn
-
readonly Connection conn
The connection that this statement uses.
- execute
-
Execute a SQL statement and if applicable return the number of rows modified.
-
new make(Connection conn, Str sql)
Make a new statement with the specified SQL text.
-
internal Statement prepare()
Prepare this statement for use with the specified connection.
- query
-
Obj[] query(Str:Obj params, Type of := def)
Execute the statement and get a relational table as the result. If
of
isnull
, the result is returned as aList
ofRows
. TheCols
are available fromList.of.fields
or ontype.fields
of each row instance. Ifof
is specified, then the result is returned as aList
of that type. Columns are mapped to the type's fields. If a column cannot be mapped to a field, then anSqlErr
is thrown. - queryEach
- sql
-
readonly Str sql
The SQL text used to create this statement.