Closed abmusse closed 6 years ago
Original comment by Xu Meng (Bitbucket: mengxumx, GitHub: dmabupt).
Yes, indicator 3 tells idb-connector the parameter is null -->
[null, db.SQL_PARAM_INPUT, 3]
This is the old way to set the data type, but from v1.0.9, it can automatically detect the data types. Considering compatibility, I still keep the indicator 0(CLOB), 1(null-terminated-string), 2(integer), 3(null) and added two new types 4(decimal), 5(boolean) --
Original comment by Jesse G (Bitbucket: ThePrez, GitHub: ThePrez).
Looking at dbstmt.cc, I see:
else if(bindIndicator == 3) { //Parameter is NULL
SQLINTEGER nullLen = SQL_NULL_DATA;
DEBUG("SQLBindParameter [%d] = NULL \n", i + 1)
rc = SQLBindParameter(obj->stmth, i + 1, SQL_PARAM_INPUT, SQL_C_DEFAULT, dataType, paramSize, decDigits, buf, 0, &nullLen);
}
So, I'd expect passing a '3' in as the bind indicator (instead of a 1 for character, 2 for numeric) would do the trick. @KerimG, can you verify?
If so, we should define and document const values for the possible bind indicators or 0, 1, 2, and 3.
Original report by Kerim Gueney (Bitbucket: KerimG, GitHub: KerimG).
I have a database table that has nullable columns and I want to multiple rows in one go. The data contains null values in various places. As in, I cannot just leave out an entire column in my insert statement but rather need an explicit way to insert null.
Is that currently possible? If yes, how would I do that?