Skip to content

Batch INSERT (using array of arrays) results in the application hanging #261

@jpmnteiro

Description

@jpmnteiro

Hey!

I'm trying to parameterise an INSERT statement and feeding executeStatement an array of arrays so that I can batch INSERTs into a table.

However, it seems like instead of working (or failing), the driver never responds and the application just hangs.

Example:

const query = `INSERT INTO test(id) values(?)`.
const params = [[1], [2], [3]];
const session = /* call some code to get a DBX session /* 
const op = session.executeStatement(query, { ordinalParameters: params })
...

If I fully create the INSERT query, INSERT INTO test(id) values (1), (2), (3), it works just fine.

I had a look at how executeStatement handles parameters and it doesn't seem to support arrays of arrays, so I am at loss of how to batch insert with parameterisation.

Env:

  • Running on Node 20.x and version 1.8.4 of the driver.

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