1.1.1

Table Of Contents
totalPrice typeSchema.price
);
Although UDTs have no natural order, you can use generated columns to provide useful sort orders:
ALTER TABLE order
ADD COLUMN normalizedValue DECIMAL( 31, 5 ) GENERATED ALWAYS AS
( convert( 'EUR', TIMESTAMP('2005-01-01 09:00:00'), totalPrice ) );
CREATE INDEX normalizedOrderPrice ON order( normalizedValue );
You can use factory functions to construct UDTs. For example:
INSERT INTO order( customerID, totalPrice )
VALUES ( 12345,
makePrice( 'USD',
CAST( 9.99 AS DECIMAL( 31, 5 ) ),
TIMESTAMP('2009-10-16 14:24:43') ) );
Once a UDT column has been populated, you can use it in other INSERT and UPDATE statements. For example:
INSERT INTO backOrder SELECT * from order;
UPDATE order SET totalPrice = ( SELECT todaysDiscount FROM discount );
UPDATE order SET totalPrice = adjustForInflation( totalPrice );
Using functions, you can access elds inside UDTs in a SELECT statement:
SELECT getCurrencyCode( totalPrice ) from order;
You can use JDBC API setObject() and getObject() methods to store and retrieve values of UDTs. For example:
PreparedStatement ps = conn.prepareStatement( "SELECT * from order" );
ResultSet rs = ps.executeQuery();
while( rs.next() )
{
int orderID = rs.getInt( 1 );
int customerID = rs.getInt( 2 );
Price totalPrice = (Price) rs.getObject( 3 );
...
}
CREATE VIEW
Views are virtual tables formed by a query.
Syntax
CREATE VIEW view-name
[ ( simple-column-name [, simple-column-name] * ) ]
AS view_query
Description
Views are virtual tables formed by a query. A view is a dictionary object that you can use until you drop it.
Views are not updatable.
vFabric SQLFire User's Guide510
vFabric SQLFire Reference