Skip to content

Cant insert date with executeMany #1112

@chsnt

Description

@chsnt
queryString = `INSERT INTO TABLENAME ( DATEBORN ) VALUES ( to_date(:dtb, 'DD.MM.YYYY') )`;

optionsObj = {  
    autoCommit: true,
        bindDefs: {    
        dtb:    { type: oracledb.DATE }     
    } 
}   

bindsArr =[ { dtb: '11.05.2019' }, { dtb: '20.06.2019' } ]

connection = await oracledb.getConnection(
    { 
        user: dbConfig.user, 
        password: dbConfig.password, 
        connectString: dbConfig.connectString
    });                

 // There error: [Error: NJS-011: encountered bind value and type mismatch]
result = await connection.executeMany(     
        queryString
       ,bindsArr
       ,optionsObj
);   

I can't insert the date into the database using executeMany. There is no problem with other types of data.
Also, the date is successfully added using execute.
What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions