All Forums Database
jesse.eichar 5 posts Joined 03/11
29 Mar 2011
Is a strict mode for inserting strings possible

I have created a table with a column that is varchar(5). When I insert a string of 6 characters the string is truncated to 5 characters rather than throwing an exception. Is there a way to force a strict mode so this will result in an error?


jesse.eichar 5 posts Joined 03/11
29 Mar 2011

Some sql to demonstrate the issue:

create table ft3 (string varchar(5));
insert into ft3 ('hello');
insert into ft3 ('1234567');
select * from ft3;

the last select results in:


I would have liked an error instead of truncating 1234567

kostek 29 posts Joined 11/09
29 Mar 2011


You have to change transaction semantics from teradata to ANSI

in bteq, before logon:

.set session transaction ANSI;

You must sign in to leave a comment.