In today’s tutorial, I want to start with the different data types available to use when creating tables using SQL on the IBM iSeries (system i, Power i, AS400).

I am only including common ones below.

Data TypesDescriptionExample
VARCHARStores variable length textName = ‘Alice’
CHARStores fixed length textCountry Code = ‘USA’
INTEGERStores whole number (positive or negative)Employee ID = 101
SMALLINTStores smaller whole numbers, requiring less storageAge = 25
BIGINTStores very large integersPopulation = 10000000
DECIMAL (DEC)Stores fixed point numbersSalary = 51234.75
BOOLEANStores true/false value. Often used for flagsTrue (1)
False (0)
DATEStores date in YYYY-MM-DD formatHire date = ‘2024-10-25’
TIMEStores time in HH:MM:SSStart Time = ’09:00:00′
TIMESTAMPStores date and time with secondsOrder Placed = ‘2024.10.25 10:15:30.123’
Posted in

Leave a Reply

Discover more from Candy Hein Consulting

Subscribe now to keep reading and get access to the full archive.

Continue reading