SQLBulkOperations question

From: TSH (mathematicus_at_yahoo.com)
Date: 11/19/04

  • Next message: Dmitri Ivanov: "Re: SQLBulkOperations question"
    Date: Fri, 19 Nov 2004 11:46:39 -0500
    
    

    In trying to write to a table WITH a primary key, suppose that there are TWO
    different arrays containing the desired data that need to be written one
    after the other. The arrays are not of the same length.

    The procedure would be something like:

    SQLBindCol(StmtHndl, column, SQL_dataType, Pointer to array1...
    SQLBulkOperations(StmtHndl,SQL_ADD,...
    SQLBindCol(StmtHndl, column, SQL_dataType, Pointer to array2...
    SQLBulkOperations(StmtHndl,SQL_ADD,...

    Upon doing this,
    The first array is written ok, but onthe second BulkOps the driver gives an
    error saying that duplicate values are being written though there are NO
    such duplcates between the contents of the arrays.
    The error seems to be given on the SECOND row of the array2, the first row
    gets written ok.

    Other symptoms:
    If the table does not have a primary key things go ok.
    OR
    If the first arrays is recycled to hold the second batch of data SO THAT the
    second BINDCOL is deleted, things go ok.

    So I need to know how can one write more than one array of data via BulkOps
    without the totla data being a multiple of the first array?

    Any hints will be appreciated
    Ernesto


  • Next message: Dmitri Ivanov: "Re: SQLBulkOperations question"

    Relevant Pages

    • Choose two numbers
      ... code finds the largest number in the first row of the first array ... By writing these two numbers from each row of the arrays ... Dim lastrow As Long ... Wend ...
      (microsoft.public.excel.programming)
    • Re: SQLBulkOperations question
      ... The arrays are not of the same length. ... T> gives an error saying that duplicate values are being written though ... T> If the table does not have a primary key things go ok. ... T> BulkOps without the totla data being a multiple of the first array? ...
      (microsoft.public.data.odbc)
    • Question on Use of BulkOperations
      ... In trying to write to a table WITH a primary key, ... The arrays are not of the same length. ... The error seems to be given on the SECOND row of the array2, ... without the total data being a multiple of the first array? ...
      (microsoft.public.sqlserver.odbc)
    • Re: Idiom for array index that Im foreaching over?
      ... I have taken the first array to be the measure of all. ... > minimum length of all arrays offered, ... > be other useful strategies. ... Assigning to the "goob" routine both chooses this option and sets the ...
      (comp.lang.perl.misc)
    • Re: Filling a matrix with values
      ... in the matrix (starting in the second row) equal to the sum of the ... because x and y are arrays, and I need to access only two single ... the meaning of 'the element to the top-left of it'. ...
      (comp.lang.apl)

    Loading