Page 1 of 1

Data truncates without warning.

Posted: Thu 18 Jan 2007 19:46
by MarkF
Hi!

I'm using a TSmartQuery on a varchar2(10) field. If I go:

SQuery.RecNo := RecordNumber;
SQuery.Edit();
SQuery.Fields[0].AsString := 'THIS WILL NOT FIT'; // Note that the field is varchar2(10)
SQuery.Post;

The data truncates without warning me. I'd expect to get an ORA-12899 "Value too large for column" error. Is there any way to enable this to happen? Perhaps I'm just missing an option? Using ODAC 5.80.0.39 on D2006. Thanks for any help!

-Mark Ford

Posted: Mon 22 Jan 2007 11:36
by Plash
This is behaviour of the TStringField class. When you assign a value to a field, this value is truncated to field size with no exception.
If you want exception to be generated, you should use separate TOraQuery or TOraSQL component to update a table and assign values through parameters.