 |
|
ORA-01401 inserted value too large for column tips
Oracle Error Tips by Burleson
|
The Oracle docs note this about ORA-01401:
ORA-01401 inserted value too large for column
- Cause:
The value entered is larger than the maximum width defined for the
column.
- Action: Enter a value smaller than the column width or use the MODIFY option with ALTER TABLE to expand the column width
.
Here, a user encounters ORA-01401 with 9i.
Question: I have a table with 118 columns and keep receiving
ORA-01401 when I attempt to put the data in a table with a cursor. Is
there any way I can figure out which column is throwing the ORA-01401 error?
Answer: You should note that in 10g, the error has been updated and includes further
information, making it easier to resolve ORA-01401. SeeORA-12899_value_too_large_for_column.
Otherwise, you call
always test your data using PL/SQL. Or, you can always try making an
exception with PRAGMA EXCEPTION_INIT :
DECLARE
my_exception EXCEPTION;
PRAGMA EXCEPTION_INIT (my_exception, -1401);
BEGIN
insert into table () values ..............
EXCEPTION
WHEN my_exception THEN dbms_output.put_line('Column value too long');
END;