What node version?
[
https://www.netcracker.com/assets/img/netcracker-social-final.png] ƕ
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Henrik Rützou
Sent: 10 February 2017 23:03
To: Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>
Subject: [WEB400] SQL7908 error when trying to acces DB2 from node
Hi, I'm getting the following error when trying to run the above code in node.js
SEV DATE TIME FROM PGM LIBRARY INST TO PGM
LIBRARY
00 10-02-17 23:40:46,758703 QSQROUTS QSYS *STMT QSQCLI
QSYS
From module . . . . . . . . : QSQSRVRC
From procedure . . . . . . : SQSERVER
Statement . . . . . . . . . : 8224
To module . . . . . . . . . : SQLCON
To procedure . . . . . . . : SQLConnect
Statement . . . . . . . . . : 13395
Message . . . . : Job 005884/QUSER/QSQSRVR used for SQL server mode
processing.
Årsag . . . . . : A Structured Query Language (SQL) statement was executed
while running in SQL server mode. SQL statements for this connection or
thread will be processed in job 005884/QUSER/QSQSRVR. Teknisk beskrivelse .
. . . . . . . : SQL server mode was requested by either setting the
SQL
server mode job attribute, or by setting the server mode environment
attribute via the SQL Call Level Interface. When running in this mode, SQL
statements are processed by a separate job, which runs under the user
profile specified for the connection. The thread identifier is 2 and the
connection is to Relational Database C602082A. If the Relational Database
name is *N, this means that all connections for the thread will use the same
job.
The node.js server i started by a submittet job and tries to run this code:
// Input from DB2
var db = require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/db2i/lib/db2a');
var sql = "SELECT STATE,LSTNAM FROM QIWS.QCUSTCDT";
var dbconn = new db.dbconn(); // Create a connection object.
dbconn.conn("*LOCAL"); // Connect to a database.
var stmt = new db.dbstmt(dbconn); // Create a statement object of the
connection.
stmt.exec(sql, function(result) {
console.log("Result: %s", JSON.stringify(result)); var fieldNum = stmt.numFields(); console.log("There are %d fields in each row.", fieldNum); console.log("Name | Length | Type | Precise | Scale | Null"); for(var i = 0; i < fieldNum; i++) { console.log("%s | %d | %d | %d | %d | %d", stmt.fieldName(i), stmt.fieldWidth(i), stmt.fieldType(i), stmt.fieldPrecise(i), stmt.fieldScale(i), stmt.fieldNullable(i)); };
delete stmt; // Clean up the statement object.
dbconn.disconn(); // Disconnect from the database.
delete dbconn; // Clean up the connection object.
});
Any guess?
--
Regards,
Henrik Rützou
http://powerEXT.com <
http://powerext.com/>
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
________________________________
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
As an Amazon Associate we earn from qualifying purchases.