Creating a TimeSeries subtype
To create a column of type TimeSeries, you must first create a row subtype to represent the data held in each element of the time series.
About this task
Subtypes for both regular and irregular time series are created in the same way.
Procedure
To create the row subtype, use the SQL CREATE ROW TYPE
statement and specify that the first field has a DATETIME YEAR TO
FRACTION(5) data type.
The row type must conform to the
syntax of the TimeSeries data type.
Examples
The following example creates a TimeSeries subtype,
called stock_bar:
create row type stock_bar(
timestamp datetime year to fraction(5),
high real,
low real,
final real,
vol real
);
The following example creates a TimeSeries subtype,
called stock_trade:
create row type stock_trade(
timestamp datetime year to fraction(5),
price double precision,
vol double precision,
trade int,
broker int,
buyer int,
seller int
);