[odb-users] Getting the datatype length

Javier Gutierrez javier.gutierrez at web.de
Wed Dec 11 02:16:46 EST 2024


Hi Boris,

I am getting the error "Data too long for column" which of course means I
have to shorten the data to the column length before persisting.
Now, let's say I define my column this way:

#pragma db value_type("VARCHAR(255)")

Is it possible to somehow retrieve the datatype length from the definition?
(I'd like to prevent hardcoding all these lengths in my code.)
Or to force ODB to truncate the values to that length?

Thanks in advance.

Best regards,
Javier Gutierrez




More information about the odb-users mailing list