4D v16

ODBC_SQLBulkOperations

ホーム

 
4D v16
ODBC_SQLBulkOperations

ODBC_SQLBulkOperations 


 

ODBC_SQLBulkOperations ( stmtID ; operation ) -> 戻り値 
引数   説明
stmtID  倍長整数 in Statement ID
operation  倍長整数 in Operation to perform
戻り値  倍長整数 in 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:

ConstantValue
SQL_ADD4
SQL_UPDATE_BY_BOOKMARK5
SQL_DELETE_BY_BOOKMARK6
SQL_FETCH_BY_BOOKMARK7


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 &NBSP` 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") &NBSP`Define which table
 $result:=ODBC_SQLExecute($statementID)
 $result:=ODBC_SQLBindCol($statementID;1;->arID) &NBSP`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) &NBSP`SQL_ADD
 
 $result:=ODBC_SQLRowCount($statementID;vRowCount)



参照 

ODBC_SQLBindCol
ODBC_SQLRowCount
ODBC_SQLSetStmtAttr

 
プロパティ 

プロダクト: 4D
テーマ: ODBC_Results
番号: 16963

 
履歴 

初出: 4D ODBC Pro 2004

 
ARTICLE USAGE

4D ODBC Pro ( 4D v16)