A SQL expression.
A non-negative integer or
A list of symbols.
prepare-statement returns a prepared-statement object for the SQL statement sql-exp in the database database. sql-exp can contain bind-variables in the form
:n where n is a positive integer.
If database is supplied, then the prepared-statement is associated with the database. Otherwise set-prepared-statement-variables will do the association even if it is called without a database.
:stringforces the variable to be passed to the database as a string. That may be useful if you have numeric values in Lisp which are stored as strings in the database.
:datecause an integer to be interpreted as a universal-time and be converted properly to an Oracle date.
If variable-types is not supplied, then the types will be chosen dynamically from the values passed to set-prepared-statement-variables.
flatp and result-types are interpreted the same as in select.
The result of
prepare-statement is a prepared-statement. This can be used by calling set-prepared-statement-variables to actually bind the variable, and then use one of the querying or executing interfaces that take a SQL expression argument: execute-command, query, do-query, simple-do-query, map-query and the
loop for...being each record construct.
A prepared-statement that is associated with a database should be destroyed (by destroy-prepared-statement) before the database is closed, otherwise it may leak memory.
LispWorks User Guide and Reference Manual - 13 Feb 2015