What should be a datatype for an INDICATOR ( flag) byteint or char(1) if trying to say Y or N

Data Modeling
rs2
Enthusiast

What should be a datatype for an INDICATOR ( flag) byteint or char(1) if trying to say Y or N

 
1 REPLY
Teradata Employee

Re: What should be a datatype for an INDICATOR ( flag) byteint or char(1) if trying to say Y or N

BYTEINT stores an integer in the range from -128 to 127.

 

CHAR(1) stores a character. If you want to store a character 'Y' or 'N' then CHAR(1) is more appropriate.

 

You may also consider adding a constraint to the column to enforce that only the two values 'Y' and 'N' are stored in the column.