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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

Literals<br />

Literals<br />

• If the maximum number of elements in the target array is greater than the number of<br />

elements in the source array, the assignment of each of the source element values to the<br />

target elements occurs and the rest of the target elements will be assigned values of NULL.<br />

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

INSERT into TBL values (1, ’111;222;333’);<br />

UPDATE TBL SET C2 = ’777;888;999’;<br />

Comparison<br />

OpenEdge <strong>SQL</strong> provides two scalar comparison operators: = and . Two arrays are<br />

comparable if their element data types are mutually comparable. During comparison, the<br />

elements are compared pair-wise in element order. Two arrays are equal if:<br />

• They both have the same number of elements<br />

• Each pair of elements is equal<br />

Two arrays are not equal if:<br />

• They do not have the same number or elements<br />

• At least one pair of elements is not equal<br />

A literal, also called a constant, is a type of expression that specifies a constant value. Generally,<br />

you can specify a literal wherever <strong>SQL</strong> syntax allows an expression. Some <strong>SQL</strong> constructs<br />

allow literals but disallow other forms of expressions.<br />

There are three types of literals:<br />

• NUMERIC<br />

• CHARACTER-STRING<br />

• DATE-TIME<br />

The following sections discuss each type of literal.<br />

Numeric literals<br />

A numeric literal is a string of digits that <strong>SQL</strong> interprets as a decimal number. <strong>SQL</strong> allows the<br />

string to be in a variety of formats, including scientific notation.<br />

This is the syntax for numeric literals:<br />

203

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

Saved successfully!

Ooh no, something went wrong!