|
<< Click to Display Table of Contents >> Sybase CT-Lib driver |
![]() ![]()
|
This topic discusses features unique to the Sybase CT-Lib SQL Link driver.
DBIERR_MULTIPLEUNIQRECS on dead tables
If the error DBIERR_MULTIPLEUNIQRECS occurs while using a dead table (no index at all), then the cursor for that table should be closed and reopened, regardless of whether DbiBeginTran had been called to start a transaction.
Multiple active stored procedure support
The Sybase CT-Lib SQL Link driver can now perform row fetches from multiple stored procedures simultaneously using the new property stmtEXECASCURSOR.
The stmtEXECASCURSOR property allows users to ask for a CT-Lib cursor instead of a CT-Lib command. CT-Lib cursors let the user have multiple cursors open and fetch rows from those simultaneously. With CT-Lib commands, all pending results must be processed before executing the next operation. This property is mainly for users who execute Sybase stored procedures that return a result set. They can pass the SQL string as "EXECUTE proc_name" or "EXECUTE proc_name :1, :2, :3 ..." (if there are parameters), prepare the statement, then set stmtEXECASCURSOR to True. This makes the driver open cursors on the stored procedure instead of a command.
Some limitations to this property:
| 1. | The stored procedure should not have any BDE output parameters or return status. |
| 2. | Input parameters must be place holders in the SQL string and must be bound before execution. (Literal substitution of parameter values in the string doesn't work.) |
| 3. | The stored procedure body should contain a single SELECT statement returning a single result set. |
An example:
int main ()
{
// Initialize engine
// Connect to database
//Prepare a statement
DbiQPrepare(hDb, .., .. , phStmt);
// Set the property
DbiSetProp(hStmt, stmtEXECASCURSOR, TRUE);
// Bind parameters if any
//DbiQExec(hStmt, phCur);
.
.
.
return 0;
}