cancel
Showing results for 
Search instead for 
Did you mean: 

Error using ''sa_dbcapi_handle" in JavaScript External Environment with WIndows

0 Kudos
7,166

In trying to learn the JavaScript External Environment, I have encountered the following problem.

According to the documentation and examples, you can connect to the callers database using 'sa_dbcapi_handle' in place of the connection parameters.

While this works on Linux, it fails on Windows with the message:

Could not execute statement.
Procedure 'test2' terminated with unhandled exception 'Error: Code: -739
Msg: db_init has not been called or the call to db_init failed'
SQLCODE=-91, ODBC 3 State="HY000"
Line 15, column 1
CALL test2()

I've created a github gist (https://gist.github.com/twilkinson/6036702fae6f29f62107 ) that illustrates the problem.

There are 2 files:

  1. First copy tests.js to C:\\Temp\\tests.js.
  2. Then using ISQL, connect to the 'SQL Anywhere 17 Demo' database and execute tests.sql.

I'm running Windows-7, SA17 Developers Edition (17.0.0.1211) and node (v0.10.40).

Has anyone else seen this? Any suggestions?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

It appears to not reproduce with V5.6.0 ... I was using the same NodeJS V4.3.0 as you are running when I reproduced this ... but the issue was not reproduced by a collegue with V5.6.0. {thanks Jack}

Former Member
0 Kudos

Though it still fails for me on a Windows 8 imaged laptop. hmmmm

0 Kudos

Actually, I'm running nodejs 0.10.40 - waiting for the update to the SA17 Developer Edition for node 4+ support.

Answers (0)