Re: SQLBulkOperations question
From: Dmitri Ivanov (divanov_NOSP_at_M_.aha.ru)
Date: 11/19/04
- Previous message: TSH: "SQLBulkOperations question"
- In reply to: TSH: "SQLBulkOperations question"
- Next in thread: TSH: "Re: SQLBulkOperations question"
- Reply: TSH: "Re: SQLBulkOperations question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 19 Nov 2004 22:34:53 +0300
Hello TSH,
"TSH" <mathematicus@yahoo.com> wrote:
T> In trying to write to a table WITH a primary key, suppose that there
T> are TWO different arrays containing the desired data that need to be
T> written one after the other. The arrays are not of the same length.
T>
T> The procedure would be something like:
T>
T> SQLBindCol(StmtHndl, column, SQL_dataType, Pointer to array1...
T> SQLBulkOperations(StmtHndl,SQL_ADD,...
T> SQLBindCol(StmtHndl, column, SQL_dataType, Pointer to array2...
T> SQLBulkOperations(StmtHndl,SQL_ADD,...
T>
T> Upon doing this,
T> The first array is written ok, but onthe second BulkOps the driver
T> gives an error saying that duplicate values are being written though
T> there are NO such duplcates between the contents of the arrays.
T> The error seems to be given on the SECOND row of the array2, the
T> first row gets written ok.
T>
T> Other symptoms:
T> If the table does not have a primary key things go ok.
T> OR
T> If the first arrays is recycled to hold the second batch of data SO
T> THAT the second BINDCOL is deleted, things go ok.
T>
T> So I need to know how can one write more than one array of data via
T> BulkOps without the totla data being a multiple of the first array?
AFAIR, you are trying to add several rows in bulk from compound memory
blocks. As you have said that the arrays are not of the same length, make
sure to set the corresponding row array size every time. Are you really
changing the contents of the array for the primary key column (or rebind
it)?
Generally, interleaving SQLBindCol is not a good practice. Binding offsets
could be of value if the driver did support them.
-- Sincerely, Dmitri Ivanov Common Lisp ODBC interface - www.ystok.ru
- Previous message: TSH: "SQLBulkOperations question"
- In reply to: TSH: "SQLBulkOperations question"
- Next in thread: TSH: "Re: SQLBulkOperations question"
- Reply: TSH: "Re: SQLBulkOperations question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|