Compiled Objects
Go Up to Features and Dialects
The behavior of a compiled object such as a stored procedure, trigger, check constraint, or default value depends on the dialect setting of the client at the time the object is compiled. Once compiled and validated by the server the object is stored as part of the database and its behavior is constant regardless of the dialect of the client that calls it.
Example: Consider the following procedure:
CREATE PROCEDURE exact1 (a INTEGER, b INTEGER) RETURNS (c INTEGER) AS BEGIN c = a / b; EXIT; END;
When created by a dialect 1 client:
EXECUTE PROCEDURE
exact 1
returns 1 when executed by either a dialect 1 or dialect 3 client.
When created by a dialect 3 client:
EXECUTE PROCEDURE
exact 1
returns 0 when executed by either a dialect 1 or dialect 3 client.
Example: Consider the following procedure:
CREATE PROCEDURE bignum (a INTEGER, b INTEGER) RETURNS (c NUMERIC(18,0) AS BEGIN c = a * b; EXIT; END;
When created by a dialect 1 client:
EXECUTE PROCEDURE
bignum
(65535, 65535) returns –131071.0000 when executed by either a dialect 1 or dialect 3 client.
When created by a dialect 3 client:
EXECUTE PROCEDURE
bignum
(65535, 65535) returns *ERROR* can’t access INT64
when executed by a dialect 1 client.
EXECUTE PROCEDURE
bignum
(65535, 65535) returns 4294836225 when executed by a dialect 3 client.