Skip to content

cannot insert file binary #1

Description

@harry-chin

I tried to put binary file(varbinary(max)) into sql server using this library.
fileBinary data type is QByteArray.

        auto queryResult = Query(FILE)
            .insert({"customer_id", "file_name", "file_binary"})
            .values({customerId, fileName.data(), fileBinary})
            .perform();

This is causing follows;
StatementError: [Microsoft][ODBC SQL Server Driver][SQL Server]Implicit conversion from data type varchar(max) to varbinary(max) is not allowed. Use the CONVERT function to run this query. QODBC3: Unable to execute statement

Activity

  1. aaronDevLinux commented on Feb 26, 2025

    @aaronDevLinux

    Same problem here, but in sqlite3.

    Problem is that author of this project converts whole universe to QString, e.g.:

    QList<int> InserterPerformer::perform() &&
    {
        QList<int> result;
    
        QStringList valueTail;
        for(const QVariantList& dataTuple : impl->m_data)
        {
            QStringList vBlock;
            for(const QVariant& value : dataTuple)
                vBlock << OP::Clause::escapeValue(value);
    
            valueTail << QString("(%1)").arg(vBlock.join(','));
        }
    

    Seeing no activity in past 2 years this project is unfortunately unusable.

  2. MasterAler commented on Dec 26, 2025

    @MasterAler
    Owner

    @aaronDevLinux , @harry-chin yepp, that was a prototype of some code that became proprietary
    Now I'm free from legal limitations and can fix whatever issues here.

    Sorry for abandoning the github for a while.

    Also column disambiguation sucks for complex SQL, I'll probably bring in some simple scheme support to improve that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions