Skip to content

ODBC Bulk Insert of Blobs using SQLPrepare/SQLBindParameter/SQLExecute  #8

@ClaudioMuselli90

Description

@ClaudioMuselli90

I want to signal a possible bug in the odbc driver for SQLite 3 in the bulk insert of data in a SQLITE_BLOB column.
I am using this driver under Windows and Linux and I have the same results.
By inserting 100 lines of binaries values using the query

INSERT INTO "table" ("column_data") VALUES (?)

and using SQLBindParameter to pass the binary buffer and the vector of different length, I am resulting with an insert of my blobs all truncated to the length of the first entry. I have used SQLSetStmtAttr to set SQL_ATTR_PARAMSET_SIZE to 100 to insert 100 lines together for performance reason.
The column is defined as BLOB type on the db and the last len entry of SQLBindParameter is a vector containing all the correct 100 sizes. Unfortunately it seems that this last vector is ignored by the routine. Same code works well with null terminated string if SQL_NTS value is used instead of the precise number of bytes.

Moreover I used another version of ODBC driver for SQLite (not open-source unfortunately) and with the same code the insert proceed correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions