23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Data</strong> types<br />

• There is no support for an UPDATE of an LVARBINARY column on a table that contains a<br />

column of data type LVARBINARY. Obtain the functionality of an UPDATE on an LVARBINARY<br />

column by using the DELETE and INSERT statements for the record.<br />

Utility support for LVARBINARY<br />

Use BINARY DUMP/LOAD to dump and load data that contains the LVARBINARY data type. <strong>SQL</strong>DUMP<br />

and <strong>SQL</strong>LOAD do not support tables with LVARBINARY column data.<br />

Array data types<br />

The ARRAY data type is a composite data value that consists of zero or more elements of a<br />

specified data type (known as the element type). VARARRAY data type allows the size of an<br />

individual element value to exceed its declared size as long as the total size of the array is<br />

smaller than the array’s <strong>SQL</strong> width.<br />

The VARARRAY type is most compatible with the ABL array data definitions. For best<br />

compatibility with the ABL, use the VARARRAY type. The ARRAY type is less ABL compatible and<br />

more <strong>SQL</strong> standard compliant.<br />

This is the syntax for the array data type:<br />

Syntax<br />

data_type ARRAY[int] | VARARRAY[int]<br />

data_type<br />

[int]<br />

The data type of the array. This is also known as the element type.<br />

Supported data types are: BINARY, BIT, CHAR, VARCHAR, DATE, DECIMAL, DOUBLE<br />

PRECISION, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP,<br />

TIMESTAMP_TZ, TINYINT, and VARBINARY.<br />

An unsigned integer, indicating the array’s maximum element size.<br />

Example In this example, table TBL is created. TBL has two columns: column C1 is an array of up to 3<br />

elements, all of them type int and column C2 is a variable-sized array of up to 4 elements, all<br />

of them type varchar:<br />

CREATE TABLE TBL (C1 int ARRAY[3], C2 varchar(5) VARARRAY[4]);<br />

The size of any element in C2 can be up to 20 characters (5*4) with a total size of 20 characters.<br />

Notes • OpenEdge <strong>SQL</strong> limits an array’s size. The array’s size must be an integer between 1 and<br />

9999.<br />

• Array columns and element references cannot be indexed because:<br />

– You cannot define a UNIQUE key with columns of type ARRAY.<br />

201

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!