Closed frameworker2019 closed 1 year ago
There is no way to meaningfully store NULL
in an int
variable. This means you have to provide a default value that SOCI can fall back on.
The relevant section in the documentation:
get
functions that return the value of the column given by position or name. If the column contains null, then these functions either return the provided "default"nullValue
or throw an exception.
This is indeed working as expected, so closing.
It seems even the table declaration allows a NULL value, SOCI throws always the "Null value not allowed" exception:
This is my code:
To circumvent the situation I have to write:
even the table definition does not declare a NOT NULL constraint on the "id" column. Is this an understanding issue that I have?