Can we run an sql file via node-ibm_db?

99 views
Skip to first unread message

Jonathan Tan

unread,
Oct 12, 2017, 11:35:18 AM10/12/17
to node-ibm_db
Cause this would be a great feature that supports things like IaaC and migrating tables/indices/constraints/etc.

bimaljha

unread,
Oct 23, 2017, 12:15:18 PM10/23/17
to node-ibm_db
No you can not run. ibm_db APIs accepts SQL statements only not the file name containing set of SQL statements. That happens in Db2 CLP for executing queries in batches.
Such features would not limit only on DDL but should work for DML also. If an sql file has 10 select statements returning thousands of rows by each select statement, how such scenarios will get handled? Please provide more info about IaaC. How you want to received the selected data and what should be input/output of API if we think to provide any for such feature? Thanks.

bimaljha

unread,
Jan 27, 2020, 2:29:21 AM1/27/20
to node-ibm_db
Yes, using ibm...@2.6.3, you can execute sqlfile. It is documented here: https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md#executeFileApi
Reply all
Reply to author
Forward
0 new messages