ALLBASE/SQL Reference Manual (36216-90216)

Chapter 2 65
Using ALLBASE/SQL
Defining How Data is Stored and Retrieved
PUBLIC mode allows multiple transactions to concurrently read and update a table.
Locking is done at the page level.
PUBLICROW mode allows multiple transactions to concurrently read and update a table.
Locking is done at the row level, which permits greater concurrency than PUBLIC mode.
ALLBASE/SQL automatically uses the locking mode in the table definition whenever you
access a table. You can use the LOCK TABLE statement to override automatic locking. You
can use the ALTER TABLE statement to permanently change the implicit locking mode.
Tables created with PUBLICREAD, PUBLIC, and PUBLICROW options also have the following
initial authorities associated with them:
•APUBLICREAD table can be read by anyone who can start a DBE session.
•APUBLICROW or PUBLIC table can be read and updated by anyone who can start a DBE
session.
A DBA or the table's owner can use the GRANT and REVOKE statements to change these
authorities.
The choice of PUBLICROW rather than PUBLIC mode may result in a transaction's obtaining
more locks, since each row must be locked individually. For more information about the
quantity of locking in PUBLIC and PUBLICROW tables, refer to the section “Effects of Page
and Row Level Locking” in the “Physical Design” chapter of the ALLBASE/SQL Database
Administration Guide.
Naming the Table and Columns
The name you assign to a table or column can be up to 20 bytes long and is governed by the
rules in Chapter 6 , “Names.
Defining the Columns
You enclose the column definitions in parentheses, separating multiple column definitions
with a comma. At least one column must be defined. Each column is defined by a name and
a data type.
Specifying Data Types
Data types describe the kind of data that can be stored in a column. ALLBASE/SQL has
five numeric data types, two string data types, four date/time data types, and four binary
data types as follows:
Numeric data types:
DECIMAL
FLOAT
REAL
INTEGER
SMALLINT