You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to insert integer values into char columns via prepared statements, NULL values get inserted.
Code:
r = SQLPrepare(hstmt, (SQLCHAR*)"INSERT INTO test (id, text) VALUES (1, ?)", SQL_NTS); // test.text is a CHAR column
int value = 1;
SQLINTEGER i = SQL_NTS;
r = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &value, 0, &i); // binds INTEGER value to CHAR column
// last parameter should be ignored according to MSDN, but 0 leads to a crash (see Issue ODBC139).
r = SQLExecute(hstmt);
In the resulting row, test.text should contain "1" but contains NULL.
Submitted by: Sven Steinseifer (svensteinseifer)
Is duplicated by ODBC75
When I try to insert integer values into char columns via prepared statements, NULL values get inserted.
Code:
r = SQLPrepare(hstmt, (SQLCHAR*)"INSERT INTO test (id, text) VALUES (1, ?)", SQL_NTS); // test.text is a CHAR column
int value = 1;
SQLINTEGER i = SQL_NTS;
r = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &value, 0, &i); // binds INTEGER value to CHAR column
// last parameter should be ignored according to MSDN, but 0 leads to a crash (see Issue ODBC139).
r = SQLExecute(hstmt);
In the resulting row, test.text should contain "1" but contains NULL.
Commits: 6122325
The text was updated successfully, but these errors were encountered: