Home » Developer & Programmer » Precompilers, OCI & OCCI » Errors during Insert operation in Pro*C (Oracle 10.1)
Errors during Insert operation in Pro*C [message #397776] Mon, 13 April 2009 20:16 Go to next message
oracle123
Messages: 56
Registered: March 2009
Member
Hi All,

I am receiving the following error while inserting records.

"Oracle Error:ORA-12899: value too large for column "MFG_ADMIN"."GAGE_RESULTS"."COMP

whereas I am checking the length of all values before inserting and am sure that none of them are larger than column lengths.

I did some research and found this error might be due to character set.

select * from nls_database_parameters where parameter like '%CHARACTERSET';

PARAMETER                      VALUE
------------------------------ 
----------------------------------------------------------------------------------------------------
--------------------
NLS_CHARACTERSET               UTF8
NLS_NCHAR_CHARACTERSET         UTF8


Please let me know how can this be related to my problem or if something else is causing this error.

Thanks,
Scott.
Re: Errors during Insert operation in Pro*C [message #397782 is a reply to message #397776] Mon, 13 April 2009 22:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-12899: value too large for column %s (actual: %s, maximum: %s)
 *Cause: An attempt was made to insert or update a column with a value
         which is too wide for the width of the destination column.
         The name of the column is given, along with the actual width
         of the value, and the maximum allowed width of the column.
         Note that widths are reported in characters if character length
         semantics are in effect for the column, otherwise widths are
         reported in bytes.
 *Action: Examine the SQL statement for correctness.  Check source
          and destination column data types.
          Either make the destination column wider, or use a subset
          of the source column (i.e. use substring).

Quote:
whereas I am checking the length of all values before inserting and am sure that none of them are larger than column lengths.

Prove your claims, I tend to trust Oracle.

Regards
Michel

Re: Errors during Insert operation in Pro*C [message #398017 is a reply to message #397776] Tue, 14 April 2009 19:36 Go to previous messageGo to next message
oracle123
Messages: 56
Registered: March 2009
Member
Michel,

I once again did the same mistake. Declared the variable as char datatype and passing it in the insert statement. The value I was passing is less than the database column length but not the array holding it.

I declared it as VARCHAR datatype and it is now working fine.

Thanks,
Soctt.
Re: Errors during Insert operation in Pro*C [message #398053 is a reply to message #398017] Wed, 15 April 2009 00:48 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback.

Regards
Michel
Previous Topic: Issue with fetch in Pro*C
Next Topic: Retrieve table data from PL/SQL into OCCI
Goto Forum:
  


Current Time: Thu Mar 28 04:26:31 CDT 2024