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.

Literals<br />

Example The numeric strings in the following example are all valid:<br />

204<br />

Syntax<br />

[ + | - ] { [ 0-9 ] [ 0-9 ] ... }<br />

[ . [ 0-9 ] [ 0-9 ] ... ]<br />

[ { E | e } [ + | - ][ 0-9 ] { [ 0-9 ] } ]<br />

123<br />

123.456<br />

-123.456<br />

12.34E-04<br />

Character-string literals<br />

A character-string literal is a string of characters enclosed in single quotation marks ( ' '). To<br />

include a single quotation mark in a character-string literal, precede it with an additional single<br />

quotation mark.<br />

The INSERT statements in the following example show embedding quotation marks in<br />

character-string literals:<br />

insert into quote values('unquoted literal');<br />

insert into quote values('''single-quoted literal''');<br />

insert into quote values('"double-quoted literal"');<br />

insert into quote values('O''Hare');select * from quote;<br />

c1<br />

-unquoted<br />

literal<br />

'single-quoted literal'<br />

"double-quoted literal"<br />

O’Hare<br />

4 records selected<br />

A character string literal can contain multi-byte characters in the character set used by the <strong>SQL</strong><br />

client. Only single-byte ASCII-encoded quote marks are valid in the syntax.<br />

Date-time literals<br />

<strong>SQL</strong> supports special formats for literals to be used in conjunction with date-time data types.<br />

Basic predicates and the VALUES clause of INSERT statements can specify date literals directly<br />

for comparison and insertion into tables. In other cases, you need to convert date literals to the<br />

appropriate date-time data type with the CAST, CONVERT, or TO_DATE scalar functions.<br />

Enclose date-time literals in single quotation marks ( ' ' ).<br />

Notes • All text (names of days, months, ordinal number endings) in all date-format literals must<br />

be in the English language. The default date format is American. You can explicitly<br />

request another date format by using a format string.

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

Saved successfully!

Ooh no, something went wrong!