Comments (9)
You can call SPs by formatting your SQL query accordingly, ie "exec my_sp(?, ?....?)" or "call schema.proc(?...?)" or whatever convention your DBM uses.
from node-ibm_db.
How to call a DB2 stored proc which has input as well as output params? I checked for examples but there aren't any for the same. Can someone highlight how to use the same? This sp has just 1 out param .
If I just use call schema.samplesp(), i am getting error :
No authorized routine named "schema.SAMPLESP" of type "PROCEDURE" having compatible arguments was found. SQLSTATE=42884\n',
state: '42884' }
from node-ibm_db.
You can't call a SP with one or more params by not specifying parameters. SQL isn't javascript.
from node-ibm_db.
Thanks for pointing that out. I was able to call SP by CALL schema.samplesp(?) . If the samplesp has no out params, it is working fine. But if the SP has an out param, its failing with same error as above. Please let me know on how to handle out param while calling SP.
from node-ibm_db.
Are you using nodeodbc? It doesn't support out params (yet). Declare a cursor for return if you want to retrieve values from your SP.
from node-ibm_db.
I'm getting the same issue as fetchMode:4. I am trying to call stored Proc with out parameters. How do I know if i am using nodeodbc. I havent installed any seperate driver. I just did the npm install ibm_db. Im using a mac so i had to DYLD_LIBRARY_PATH=<node_modules_dir>/ibm_db/installer/clidriver/lib/icc:$DYLD_LIBRARYPATH
from node-ibm_db.
@ander2 @rahulpratik @wisewins See #7. It has the details of the work-around mentioned above by @RocketRooster
from node-ibm_db.
Code changes related to Stored Procedure support is pushed on github and will be released soon. You can get it by using npm install git+https://[email protected]/ibmdb/node-ibm_db.git
command.
To know how to pass OUT and INPUT parameters for SP, see the test examples which is calling stored procedure synchronously and asynchronously : https://github.com/ibmdb/node-ibm_db/blob/master/test/test-call-stmt.js
https://github.com/ibmdb/node-ibm_db/blob/master/test/test-call-async.js
Code is currently under testing.. if you face any issue, please report here. This issue will get closed once we release a new version with support of SP. Thanks.
from node-ibm_db.
@ander2 @rahulpratik @wisewins [email protected] is released with stored procedure support. You can check https://github.com/ibmdb/node-ibm_db#callStmt for more info. Thanks.
from node-ibm_db.
Related Issues (20)
- Unable to install ibm_db on z/os HOT 8
- Bug Report - Unable to bind null value for BIGINT INOUT param HOT 13
- Error Odbc_binding.node while trying to start node app.js HOT 4
- ibm_db crashes node with OUTPUT parameter of type BINARY and Data of type Buffer HOT 1
- ibm_db crashes node with OUTPUT parameter of type BINARY and Data of type non-Buffer
- Nextjs issue with indexOf HOT 1
- unable to install [email protected] on windows with node v18.16.1 HOT 9
- ibm_db installation fails with error - /bin/sh: node-gyp: command not found HOT 9
- unable to install ibm_db on windows 11 HOT 1
- Error: getaddrinfo ENOTFOUND public.dhe.ibm.com HOT 6
- Error: getaddrinfo ENOTFOUND public.dhe.ibm.com HOT 3
- Outparams is null when using connection pool and previously DB error in the connection HOT 5
- How to set timeout when using connection pool? HOT 2
- SP call failing with error HOT 2
- Not able to run or connect ibm db2 from AWS lambda
- Not able to run or connect ibm db2 from AWS lambda HOT 8
- [TypeScript] Type issue with ODBCStatement? HOT 11
- Incorrect results with XML containing Chinese data on Linux. Same code works on Windows. HOT 12
- await ODBCStatement.executeNonQuery does not work as the callback version does HOT 4
- ibm_db install on z/OS is failing HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ibm_db.