On 2/20/07, Amir Michail <[EMAIL PROTECTED]> wrote:
Hi,
Is there a way to get derby to silently truncate varchar columns?
Could you use the substr function to accomplish this?
e.g.:
simple example:
create table foo (v varchar(5));
insert into foo values (substr('too long', 1, 5));
also works with prepared statements, here's an example from inside ij:
prepare ins1 as 'insert into foo values (substr(?, 1, 5))';
execute ins1 using 'values (''another'')';
ij> select * from foo;
V
-----
too l
anoth
hope that helps,
andrew