1

I am using Spring JDBCTemplate to perform a batchUpdate (insert) of a few thousand rows into an Oracle 10g database. To test my error handling, I made sure I get an exception about maximum length.

I get the following (expected) exception:

Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO colleagues (col_id, col_code, col_description, pers_id) VALUES (?, ?, ?, ?)]; SQL state [72000]; error code [12899]; ORA-12899: value too large for column "MYSCHEMA"."COLLEAGUES"."COL_DESCRIPTION" (actual: 57, maximum: 40);

nested exception is java.sql.BatchUpdateException: ORA-12899: value too large for column "MYSCHEMA"."COLLEAGUES"."COL_DESCRIPTION" (actual: 57, maximum: 40)

My question is, what is the value of col_description causing this exception? As you can see, the query does not show the actual values but only the ? of the prepared statement.

4

1 に答える 1

0

db dable からデータを取得する場合は、ソース テーブルから無効なデータ列を選択してみてください

select * from COLLEAGUES_source_column 
where length(COL_DESCRIPTION_source_column) > 40
于 2012-06-21T13:59:00.313 に答える