GithubHelp home page GithubHelp logo

Stored procedure support about node-ibm_db HOT 9 CLOSED

ibmdb avatar ibmdb commented on July 3, 2024 2
Stored procedure support

from node-ibm_db.

Comments (9)

RocketRooster avatar RocketRooster commented on July 3, 2024

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.

rahulpratik avatar rahulpratik commented on July 3, 2024

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.

RocketRooster avatar RocketRooster commented on July 3, 2024

You can't call a SP with one or more params by not specifying parameters. SQL isn't javascript.

from node-ibm_db.

rahulpratik avatar rahulpratik commented on July 3, 2024

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.

RocketRooster avatar RocketRooster commented on July 3, 2024

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.

wisewins avatar wisewins commented on July 3, 2024

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.

zenflow avatar zenflow commented on July 3, 2024

@ander2 @rahulpratik @wisewins See #7. It has the details of the work-around mentioned above by @RocketRooster

from node-ibm_db.

bimalkjha avatar bimalkjha commented on July 3, 2024

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.

bimalkjha avatar bimalkjha commented on July 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.