Here is a test program that demonstrates the error. With the db.conn
statement in there you will get the HY010 error. If you comment out the
db.conn it will work.



var db = require('/QOpenSys/QIBM/ProdData/Node/os400/db2i/lib/db2')
var xt =
require('/QOpenSys/QIBM/ProdData/Node/os400/xstoolkit/lib/itoolkit')
var conn = new xt.iConn("*LOCAL")

db.init()
db.conn("*LOCAL")

// set the user and password to test
// the console will show "success:false" or "success:true"
validateUser("username","password")

function validateUser(userName, password){
var pgm = new xt.iPgm("QSYGETPH",{"lib":"QSYS","error":"on"})
var x

pgm.addParam(userName.toUpperCase(), "10A")
pgm.addParam(password.toUpperCase(), "10A")
pgm.addParam(" ", "12A", {"io":"out", "hex":"on"})
pgm.addParam([
[0,"10i0"],
[0,"10i0"],
[" ", "7A"],
[" ", "1A"],
[" ", "256A"]
])
pgm.addParam(10, "10i0")
pgm.addParam(-1, "10i0")
conn.add(pgm.toXML())
conn.debug(true)
function my_call_back(str) {
var results = xt.xmlToJson(str)
console.log(str)
if(results.length == 0){
console.log("success:true")
x = true
} else {
results.forEach(function(result,index){
if(result.hasOwnProperty('success')){
console.log("success:" + result.success)
x = result.success
} else {
console.log("success:true")
x = true
}
})
}
}
conn.run(my_call_back)
return x
}






On Mon, 9 May at 2:53 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:

Do you have a small/generic example for us to test?

Aaron Bartell
litmis.com - Services for open source on IBM i


On Mon, May 9, 2016 at 2:50 PM, Brian Garland <brian.garland@xxxxxxxxxx>
wrote:

I have a node.js program that is using itoolkit/xmlservice to call an
IBM i
api.

If I add the db2 library anda db2 connection to the program the itoolkit
connection will fail with [Error: SQLSTATE=HY010 SQLCODE=-99999 Error
occured in SQL Call Level Interface].

Any idea how to do program calls and have a DB2 connection at the same
time?


--
Brian J. Garland
Vermont Information Processing, Inc.
brian.garland@xxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.