1.1

Table Of Contents
To avoid recursive calls to a trigger, you can use a table column as a ag to stop triggering
further events. For example:
CREATE TRIGGER trig3
AFTER UPDATE OF the_flag ON test_table
REFERENCING NEW AS updatedRow
FOR EACH ROW
UPDATE test_table SET edited_by = 'fromUpdateTrigger',
edited_date = CURRENT_DATE WHERE the_data=updatedRow.the_data
AND
(edited_by <> 'fromUpdateTrigger' or edited_by IS NULL);
CREATE TYPE
The CREATE TYPE statement creates a user-dened type (UDT). A UDT is a serializable Java class whose
instances are stored in columns. The class must implement the java.io.Serializable interface.
Syntax
CREATE TYPE [ schema-name. ] SQL92Identifier
EXTERNAL NAME singleQuotedJavaClassName
LANGUAGE JAVA
The type name is composed of an optional schemaName and a SQL92Identier. If a schemaName is not provided,
the current schema is the default schema. If a qualied type name is specied, the schema name cannot begin
with SYS.
If the Java class does not implement java.io.Serializable, or if it is not public and visible on the classpath, SQLFire
raises an exception when preparing statements which refer to the UDT.
A UDT cannot be cast explicitly to any other type, and no other type can be cast to a UDT.
A UDT has no ordering. This means that you cannot compare and sort UDTs. You cannot use them in expressions
involving the <, =, >, IN, BETWEEN, and LIKE operators. You cannot use UDTs in aggregates, DISTINCT
expressions, and GROUP/ORDER BY clauses. You cannot build indexes on them.
You can use subtypes in UDTs. That is, if you use the CREATE TYPE statement to bind a class named C to a
UDT, you can populate that UDT value with an instance of any subclass of C.
Example
CREATE TYPE price
EXTERNAL NAME 'com.acme.types.Price'
LANGUAGE JAVA;
Using user-defined types
You can create tables and views with columns that have UDTs. For example:
CREATE TABLE order
(
orderID INT GENERATED ALWAYS AS IDENTITY,
customerID INT REFERENCES customer( customerID ),
vFabric SQLFire User's Guide494
vFabric SQLFire Reference