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 Types | Description | Example |
| VARCHAR | Stores variable length text | Name = ‘Alice’ |
| CHAR | Stores fixed length text | Country Code = ‘USA’ |
| INTEGER | Stores whole number (positive or negative) | Employee ID = 101 |
| SMALLINT | Stores smaller whole numbers, requiring less storage | Age = 25 |
| BIGINT | Stores very large integers | Population = 10000000 |
| DECIMAL (DEC) | Stores fixed point numbers | Salary = 51234.75 |
| BOOLEAN | Stores true/false value. Often used for flags | True (1) False (0) |
| DATE | Stores date in YYYY-MM-DD format | Hire date = ‘2024-10-25’ |
| TIME | Stores time in HH:MM:SS | Start Time = ’09:00:00′ |
| TIMESTAMP | Stores date and time with seconds | Order Placed = ‘2024.10.25 10:15:30.123’ |
Leave a Reply