|
|||||
db.statement
|
The db.statement OMX component is used to receive the compiled SQL statement from dbStatementCompile. Through this OMX component, the same SQL statement may be executed multiple times without the need to compile the statement at every execution. For some programs, this reduction in processing overhead can be significant.
To create a db.statement, use the db.compile-statement
function. The resulting OMX component is a link to the compiled SQL statement. The statement can then be executed either by calling the db.execute
function or by calling the db.streaming-execute
function. All placeholder values must be specified at this time. If the statement is a query, the query results are retrieved through a db.field shelf. When you have finished using the statement, you can use db.discard
to release the resources used by the db.statement OMX component. This is not generally required, as the OMX also does an automatic discard.
Please refer to OMX Components for a general description of OMX components and how they are used.
The functions
db.compile-statement
- compile an SQL statement.
db.discard
- discard a compiled SQL statement.
db.execute
- execute a compiled SQL statement, passing in parameters up front.
db.streaming-execute
- execute a compiled SQL statement, streaming in parameters dynamically.