Sets the indicator for an item of a bound place holder or a result data column.
ODBC.bdh
OdbcSetMode( in cCursor : cursor , in sIdentifier : string, in nMode : number, in nIndex : number optional ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
cCursor | Cursor associated with a database connection. |
sIdentifier | Identifier of the place holder or the result data column. To identify a place holder, begin this parameter with a colon. |
nMode |
Indicator for the place holder or column item. This parameter must be set to one of the following values:
|
nIndex | Array index for the place holder or column item whose indicator is to be set (optional). By default, this function sets the indicator for the first item. |
var hEnv, hDbc : number; cCursor : cursor; dcltrans transaction TMain var sIdentifier : string; nRow : number; begin OdbcAlloc(SQL_HANDLE_ENV, hEnv); OdbcAlloc(SQL_HANDLE_DBC, hDbc, hEnv); OdbcConnect(hDbc, "DSN=database;UID=user;PWD=pass;"); OdbcOpen(cCursor, hDbc); OdbcPrepare(cCursor, sqlInsert); OdbcBind(cCursor, ":1", SQL_C_CHAR, 32); OdbcBind(cCursor, ":2", SQL_C_LONG); OdbcSetMode(cCursor, ":1", SQL_DATA_AT_EXEC); OdbcSetMode(cCursor, ":2", SQL_DATA_AT_EXEC); OdbcExecute(cCursor); OdbcParamData(cCursor, sIdentifier, nRow); if sIdentifier = ":1" then OdbcSetString(cCursor, "", "Jim"); OdbcParamData(cCursor); OdbcSetInt(cCursor, "", 25); elseif sIdentifier = ":2" then OdbcSetInt(cCursor, "", 25); OdbcParamData(cCursor); OdbcSetString(cCursor, "", "Jim"); end; OdbcClose(cCursor, SQL_DROP); OdbcCommit(hDbc); OdbcDisconnect(hDbc); OdbcFree(hDbc); OdbcFree(hEnv); end TMain; dclsql sqlInsert: INSERT INTO persons (name, age) VALUES (?, ?);