I have a scenario where I want to insert more than 100 records in one execution only. I am developing my app in Node.JS and using trireme-jdbc for jdbc connection to openedge DB and its not allowing to perform multiple records in single execution either passing a array of multiple values or passing multiple insert query with values separated by semicolon. Due to this problem I am performing this operation in loop but its breaking the connection for records more than 20-25. Also it looks like that in trireme-jdbc db.close() really close the DB session or not. Is there any other way to close the DB connection or session in trireme-jdbc. Below is a sample cose that I am using to do this.
After executing below code its throwing SQL syntax error in Node only but inserting successfully using sql developer or Squirrel Client tool. Data base I am using is Openedge 11.6. It looks like every execution is creating a new connection automatically. Any help be appreciated.
[DataDirect][OpenEdge JDBC Driver][OpenEdge] Syntax error in SQL statement at or about "; INSERT INTO po_log (order_num, line_id" (10713) [DataDirect][OpenEdge JDBC Driver][OpenEdge] Syntax error in SQL statement at or about "; INSERT INTO po_log (order_num, line_id" (10713)
if(filePlant == 'RY1') { query = 'INSERT INTO po_log (order_num, line_id, line_release) VALUES (' + 4370024 + ' , ' + 1 + ' , ' + 2 + ' )' + ' ; ' + 'INSERT INTO po_log (order_num, line_id, line_release) VALUES (' + 4370024 + ' , ' + 1 + ' , ' + 2 + ' )' dbRY1.execute(query, [], function(err, result, rows) { loggy.info('ASN Inserted DB Error for RY1--->'+err); if(err == undefined){ loggy.info('ACK Inserted for RY1--->'); }else{ loggy.info('ACK Inserting Error occurred for RY1--->'); } }); dbRY1.close(); }
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |