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:
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, |
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} Though it still fails for me on a Windows 8 imaged laptop. hmmmm
(11 Feb '16, 18:02)
Nick Elson S...
Actually, I'm running nodejs 0.10.40 - waiting for the update to the SA17 Developer Edition for node 4+ support.
(11 Feb '16, 20:23)
Terry Wilkinson
|
There are examples of using serverside connectivity this way in the "%sqlanysamp17%\SQLAnywhere\ExternalEnvironments\JavaScript\"
Do serverside.js and serverside.sql show the same issue in your setting as well?
Yes. I tried to run those and had the same problem.
Never mind.
I just reproduce this with the 3rd example from "How to use JavaScript from the Database" page.