Working on a Java/Spring system with Oracle(19c Enterprise) database, I have recently bumped into this error:
database.org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback;
uncategorized SQLException for SQL [{? = call booking_system_pkg.create_booking(?, ?, ?)}];
SQL state [99999]; error code [17072];
Inserted value too large for column: "E2BF85FFF1DFAB55E05329CC1C0A850E";
nested exception is java.sql.SQLException: Inserted value too large for column:
"E2BF85FFF1DFAB55E05329CC1C0A850E"
I have checked that the data type of that column is varchar2(60). Since the value "E2BF85FFF1DFAB55E05329CC1C0A850E" is all ASCII characters, varchar2(60) should be enough to hold this value, isn't it?
Am I missing something here?
E2BF85FFF1DFAB55E05329CC1C0A850E is 32 characters long. Despite being all ASCII, your database will encode it using whatever encoding it is set to use. It will not mix and match encoding depending on the specific string being inserted into a column, think of how expensive and confusing searching and sorting on a table with multiple encodings would get.
If the column is indeed a varchar2(60) and "E2BF85FFF1DFAB55E05329CC1C0A850E" is too large for the column, then the logical conclusion is that the column is set to 60 bytes, not characters, and your database is using a multi-byte encoding.