Setting Default Values
Pervasive PSQL inserts a default value if you insert a row but do not provide a value for that column. Default values ensure that each row contains a valid value for the column.
In the Person table of the sample database, all students live in a state. Setting a default value such as TX for the State column ensures that the most probable value is always entered for that column.
To set a default value for a column, use a DEFAULT statement in the CREATE TABLE statement:
CREATE TABLE MyTable(c1 CHAR(3) DEFAULT ’TX’, ID INTEGER)#
SELECT * FROM MyTable#
Result of SELECT Statement:
"c1", "ID"
"TX", "1234"
1 row fetched from 2 columns