Modifies the current value of a specified SQL statement attribute.
ODBC.bdh
OdbcSetStmtAttr( in cCursor : cursor, in nAttribute : number, in sValue : string ) : boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
cCursor | Cursor associated with a database connection. |
nAttribute |
SQL statement attribute whose value is to be modified. This parameter must be set to one of the following values:
|
sValue | New value for the SQL statement attribute. |
var hEnv, hDbc : number; cCursor : cursor; dcltrans transaction TMain begin OdbcAlloc(SQL_HANDLE_ENV, hEnv); OdbcAlloc(SQL_HANDLE_DBC, hDbc, hEnv); OdbcConnect(hDbc, "DSN=database;UID=user;PWD=pass;"); OdbcOpen(cCursor, hDbc); OdbcSetStmtAttr(cCursor, SQL_ATTR_QUERY_TIMEOUT, 15); OdbcPrepare(cCursor, sqlSelect); OdbcExecute(cCursor); while OdbcFetch(cCursor) do write("name: " + OdbcGetString(cCursor, "1")); writeln(" age: " + (string)OdbcGetInt(cCursor, "2")); end; OdbcClose(cCursor, SQL_DROP); OdbcCommit(hDbc); OdbcDisconnect(hDbc); OdbcFree(hDbc); OdbcFree(hEnv); end TMain; dclsql sqlSelect: SELECT * FROM persons;