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

Invalid precision value #165

Open
kothapraveen opened this issue Mar 20, 2024 · 2 comments
Open

Invalid precision value #165

kothapraveen opened this issue Mar 20, 2024 · 2 comments

Comments

@kothapraveen
Copy link

Hi Team,
Currently we are facing below Exception, when we execute the statement query.

Exception: (0, HY104, '[mtodbc]: Binding parameter: [FreeTDS][SQL Server]Invalid precision value')

ODBC Logs:
[ODBC][16228][1710915952.043190][SQLBindParameter.c][217]
Entry:
Statement = 0x120bec0
Param Number = 11
Param Type = 4
C Type = 1 SQL_C_CHAR
SQL Type = 2 SQL_NUMERIC
Col Def = 255
Scale = 3
Rgb Value = 0x121dda0
Value Max = 258
StrLen Or Ind = 0x120b490
[ODBC][16228][1710915952.043243][SQLBindParameter.c][434]
Exit:[SQL_ERROR]
[ODBC][16228][1710915952.043374][SQLGetDiagRecW.c][535]
Entry:
Statement = 0x120bec0
Rec Number = 1
SQLState = 0x7fbecba5e8e0
Native = 0x7fbecba5e8ec
Message Text = 0x7fbecba5e4e0
Buffer Length = 511
Text Len Ptr = 0x7ffd6fed425e
DIAG [HY104] [FreeTDS][SQL Server]Invalid precision value

[ODBC][16228][1710915952.043486][SQLGetDiagRecW.c][596]
Exit:[SQL_SUCCESS]
SQLState = [HY104]
Native = 0x7fbecba5e8ec -> 0 (32 bits)
Message Text = [[FreeTDS][SQL Server]Invalid precision value].

sql logs:
odbc.c:1412:_SQLBindParameter(0x1da33d0, 11, 4, 1, 2, 255, 3, 0x1db4450, 258, 0x1da19e0)
error.c:414:odbc_errs_add: "Invalid precision value"
error_export.h:19:SQLGetDiagRecW(3, 0x1da33d0, 1, 0x7ffc36ff7e40, 0x7ffc36ff7e3c, 0x7ffc36ff7e50, 512, 0x7ffc36ff7e3a)
error.c:559:SQLGetDiagRec: "[FreeTDS][SQL Server]Invalid precision value"
error_export.h:19:SQLGetDiagRecW(3, 0x1da33d0, 2, 0x7ffc36ff7e40, 0x7ffc36ff7e3c, 0x7ffc36ff7e50, 512, 0x7ffc36ff7e3a)
error_export.h:19:SQLGetDiagRecW(3, 0x1da33d0, 1, 0x7f1d355838e0, 0x7f1d355838ec, 0x7f1d355834e0, 511, 0x7ffc36ff8ade)
error.c:559:SQLGetDiagRec: "[FreeTDS][SQL Server]Invalid precision value"
error_export.h:19:SQLGetDiagRecW(3, 0x1da33d0, 2, 0x7f1d355838e0, 0x7f1d355838ec, 0x7f1d355834e0, 511, 0x7ffc36ff8ade)
odbc.c:4259:SQLFreeStmt(0x1da33d0, 0)

as per logs SQL_NUMERIC using scale 3 which causes for the issue, but am not sure how we can avoid from this exception,
Could you please help on this issue.

Thanks in advance.

@v-chojas
Copy link
Contributor

255 doesn't sound like the right precision for a numeric... but this has nothing to do with unixODBC. Check your application.

@lurcher
Copy link
Owner

lurcher commented Mar 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants