{ $description "Returns the number of the row of the last statement inserted into the database." }
{ $see-also sqlite-open sqlite-close } ;
HELP:sqlite-prepare
{ $values { "db""the database object" }
{ "sql""the SQL statement as a string" }
{ "statement""the prepared SQL statement" }
}
{ $description "Internally compiles the SQL statement ready to be run by sqlite. The statement is executed and the results iterated over using " { $link sqlite-each } " and " { $link sqlite-map } ". The SQL statement can use named parameters which are later bound to values using " { $link sqlite-bind-text } " and " { $link sqlite-bind-text-by-name } "." }
{ "index""the index of the bound parameter in the SQL statement" }
{ "text""the string value to bind to that column" }
}
{ $description "Binds the text to a parameter in the SQL statement. The parameter to be bound is identified by the index given and the indexes start from one." }
{ $examples { $code "\"people.db\" sqlite-open\n\"select * from people where name=?\" sqlite-prepare\n1 \"chris\" sqlite-bind-text" } }
{ $description "Clean up all resources related to a statement. Once called the statement cannot be used again. All statements must be finalized before closing the database." }
{ $description "Executes the SQL statement and for each returned row calls the qutotation passing the statement on the stack. The quotation can use " { $link column-text } " to get result values for that row." }
{ $values { "statement""a prepared SQL statement" } { "quot""A quotation with stack effect ( statement -- value )" } { "seq""a new sequence" }
}
{ $description "Executes the SQL statement and for each returned row calls the qutotation passing the statement on the stack. The quotation can use " { $link column-text } " to get result values for that row. The quotation should leave a value on the stack which gets collected and returned in the resulting sequence." }