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

Some issues when calling SP with dbstmt.bindParameters() #152

Open
Didier68 opened this issue Dec 16, 2021 · 1 comment
Open

Some issues when calling SP with dbstmt.bindParameters() #152

Didier68 opened this issue Dec 16, 2021 · 1 comment
Labels
bug Something isn't working keep-open

Comments

@Didier68
Copy link

Didier68 commented Dec 16, 2021

**idb-connector version : 1.213 **

As the previous binding system with "dbstmt.bindParam" is DEPRECATED, I use for the first time the new "dbstmt.bindParameters()".

But, I had some issues while converting the existing call to the new version, which are not documented, especially with numeric values and return values:

  • For IN parameters in numeric format, it is imperative to put the right type of data in the parameter table. If a number is expected, for example, '3' does not work, it is absolutely necessary to put 3. The problem arises if we retrieve data from an SQL SELECT, where all the numeric data are returned by default in the form of a string.

Otherwise, either at a minimum the stored procedure does not receive the value, and at worst, the stored procedure is simply not called, without any error message.

  • For an OUT parameter in numerical format, it is even more true, because otherwise we get an error message:
    QLSTATE=22504 SQLCODE=-191 Mixed data or UTF-8 data not properly formed.

  • For an OUT parameter of type CHAR(N), it is imperative to provide a string of N characters, like ' '. padEnd (N, ' '), in order not to recover parasitic characters.
    In my test, for an out parameter MSGR A(132), while i was waiting for a "OK", I got strings like "OK F&REFD=00011368\u0001�;'�"]" or "OK �J��"

@Didier68 Didier68 added the bug Something isn't working label Dec 16, 2021
@github-actions
Copy link

👋 Hi! This issue has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed.

@github-actions github-actions bot added the stale label Oct 28, 2022
@abmusse abmusse added keep-open and removed stale labels Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keep-open
Projects
None yet
Development

No branches or pull requests

2 participants