Name

statement-id

statement-id options

This command performs operations on a precompiled SQL statement associated with the statement-id created using a previous database-id statement command.

statement-id [run] [args]

Execute the precompiled statement and return the result set immediately. If the command was defined with arguments, they should be specified using args, in the form of a list. The keyword [run] is optional.

Example

db statement s1 "select fullname from article where id=132"
s1
db statement s2 "select fullname from article where id1=?" INTEGER
s2 132
statement-id execute

Execute the precompiled statement but do not return the result set immediately. The results can be read one row at a time using the fetcb command.

statement-id fetch [arrayName] [columnNames]

Return the next row of a result set from a statement previously executed using the execute command.

statement-id columns [attribute...]

Return a list of ODBC statement column attributes. The attribute parameter is a list specifying which attributes to return. The attributes are listed below. The default is label.

label

Column label.

name

Column name in the original table, if available.

displaysize

The maximum string length of the column data.

type

Standard numeric SQL type.

typename

Database-specific type name string.

precision

The precision of the column, if applicable.

scale

The scale of the column, if applicable.

nullable

1 if the column is nullable.

updatable

1 if the column is updatable.

tablename

Source table of the column, if available. ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.