Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update callProcedure to handle overloaded procedures #374

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brandonp42
Copy link

fixes #372

So far I have only tested this on IBMi with a test fix ODBC driver from IBM.

…different parameters

Signed-off-by: Brandon Peterson <117427172+brandonp42@users.noreply.github.com>
@kadler
Copy link
Member

kadler commented Mar 25, 2024

TBH I don't even know why we need to call SQLProcedures/SQLProcedureColumns. The user provides the schema, procedure name, and parameters. It should be simple enough to generate a {call <procedure>(?,?,?,?)} based on the schema and procedure name along with the number of question marks based on the number of parameters passed in.

Then once you SQLPrepare the generated call escape sequence, you can use SQLDescribeParam, etc to determine what the parameters are.

@kadler
Copy link
Member

kadler commented Mar 25, 2024

Like all that could be done in https://github.com/markdirish/node-odbc/blob/d00c3ee6839ff67ca4415d53b0b9541e1fbec14a/lib/Connection.js#L161 and wouldn't need any C++ code for it at all.

Well, it wouldn't but there's no method to bind output or inout parameters currently.

@markdirish
Copy link
Contributor

Like all that could be done in

https://github.com/markdirish/node-odbc/blob/d00c3ee6839ff67ca4415d53b0b9541e1fbec14a/lib/Connection.js#L161

and wouldn't need any C++ code for it at all.
Well, it wouldn't but there's no method to bind output or inout parameters currently.

I haven't been communicating well on this project, but I do have a branch I am working on currently to get INOUT and OUT parameters working with the general Query flow (+ a call to SQLGetDescField to get the INOUT type) so that we can do exactly what you suggest with the SQLPrepare workflow. That way we can cut out the SQLProcedures and SQLProcedureColumns business.

Right now I am going through the cwb trace and trying to determine why my call to SQLGetDescField is failing in this package when it succeeds in a minimal .c file that I compile by hand.

@brandonp42
Copy link
Author

How soon will the updated query flow code be ready? Will it support capturing the return value from a stored procedure?

Copy link

stale bot commented Jun 24, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This issue hasn't seen any interaction in 30 days. label Jun 24, 2024
@markdirish markdirish added confirmed and removed stale This issue hasn't seen any interaction in 30 days. labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Error calling procedure when there are multiple versions in the same schema
3 participants