Migration from other SQL databases
No two SQL dialects are ever 100% compatible. When porting
SQL applications from other database interfaces to SESAM,
some adaption may be required. The following typical differences
should be noted:
Vendor specific data types
Some vendor specific data types may have to be replaced
by standard SQL data types (e.g., TEXT could be replaced
by VARCHAR(max. size)).
Keywords as SQL identifiers
In SESAM (as in standard SQL), such identifiers must be
enclosed in double quotes (or renamed).
Display length in data types
SESAM data types have a precision, not a display length.
Instead of int(4) (intended use: integers up to '9999'),
SESAM requires simply int for an implied size of 31 bits.
Also, the only datetime data types available in SESAM are:
DATE, TIME(3) and TIMESTAMP(3).
SQL types with vendor-specific unsigned, zerofill, or auto_increment
attributes
Unsigned and zerofill are not supported. Auto_increment
is automatic (use "INSERT ... VALUES(*, ...)"
instead of "... VALUES(0, ...)" to take advantage
of SESAM-implied auto-increment.
int ... DEFAULT '0000'
Numeric variables must not be initialized with string constants.
Use DEFAULT 0 instead. To initialize variables of the datetime
SQL data types, the initialization string must be prefixed
with the respective type keyword, as in: CREATE TABLE exmpl
( xtime timestamp(3) DEFAULT TIMESTAMP '1970-01-01 00:00:00.000'
NOT NULL );
$count = xxxx_num_rows();
Some databases promise to guess/estimate the number of
the rows in a query result, even though the returned value
is grossly incorrect. SESAM does not know the number of
rows in a query result before actually fetching them. If
you REALLY need the count, try SELECT COUNT(...) WHERE ...,
it will tell you the number of hits. A second query will
(hopefully) return the results.
DROP TABLE thename;
In SESAM, in the DROP TABLE command, the table name must
be either followed by the keyword RESTRICT or CASCADE. When
specifying RESTRICT, an error is returned if there are dependent
objects (e.g., VIEWs), while with CASCADE, dependent objects
will be deleted along with the specified table.