4D v16ODBC_SQLBulkOperations |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16
ODBC_SQLBulkOperations
|
ODBC_SQLBulkOperations ( stmtID ; operacion ) -> Resultado | ||||||||
Parámetro | Tipo | Descripción | ||||||
stmtID | Entero largo |
![]() |
Statement ID | |||||
operacion | Entero largo |
![]() |
Operation to perform | |||||
Resultado | Entero largo |
![]() |
Returns the result of the MS ODBC API function SQLBulkOperations | |||||
The ODBC_SQLBulkOperations command performs bulk insertions and bulk bookmark operations, including update, delete, and fetch by bookmark.
stmtID is a valid statement ID returned by ODBC_SQLAllocStmt.
The operation to perform are the following:
Constant | Value |
SQL_ADD | 4 |
SQL_UPDATE_BY_BOOKMARK | 5 |
SQL_DELETE_BY_BOOKMARK | 6 |
SQL_FETCH_BY_BOOKMARK | 7 |
For more information, please see the SQLBulkOperations function in the MS ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms712471(VS.85).aspx.
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NEED_DATA, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.
The following method adds three rows from data in two arrays (arID and arEmployeeName) into the Employee table:
vattrVal:=SQL_CONCUR_ROWVER
$result:=ODBC_SQLSetStmtAttr($statementID;SQL_ATTR_CONCURRENCY;->vattrVal)
vattrVal:=SQL_CURSOR_KEYSET_DRIVEN
$result:=ODBC_SQLSetStmtAttr($statementID;SQL_ATTR_CURSOR_TYPE;->vattrVal)
vattrVal:=3   ` Size of the arrays that contain our values below
$result:=ODBC_SQLSetStmtAttr($statementID;SQL_ATTR_ROW_ARRAY_SIZE;->vattrVal)
$result:=ODBC_SQLSetStmtAttr($statementID;SQL_ATTR_ROW_STATUS_PTR;->arStatus;vIndic)
vattrVal:=SQL_UB_VARIABLE
$result:=ODBC_SQLSetStmtAttr($statementID;SQL_USE_BOOKMARKS;->vattrVal)
`Use variable length bookmark
$result:=ODBC_SQLPrepare($statementID;"SELECT * FROM Employee")   `Define which table
$result:=ODBC_SQLExecute($statementID)
$result:=ODBC_SQLBindCol($statementID;1;->arID)   `Bind the columns to arrays
$result:=ODBC_SQLBindCol($statementID;2;->arEmployeeName)
arID{1}:=1006
arID{2}:=1007
arID{3}:=1008
arEmployeeName{1}:="John Smith"
arEmployeeName{2}:="Betty Jones"
arEmployeeName{3}:="Sally Peters"
$result:=ODBC_SQLBulkOperations($statementID;4)   `SQL_ADD
$result:=ODBC_SQLRowCount($statementID;vRowCount)
Producto: 4D
Tema: ODBC_Results
Número
16963
Creado por: 4D ODBC Pro 2004
4D ODBC Pro ( 4D v16)