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 />

206<br />

{ t 'hh:mi:ss' }<br />

A time literal enclosed in an escape clause is compatible with ODBC. Precede the literal<br />

string with an open brace ( { ) and a lowercase t. End the literal with a close brace ( } ).<br />

Note If you use the ODBC escape clause, you must specify the time using the format hh:mi:ss.<br />

hh<br />

mi<br />

ss<br />

mls<br />

Specifies the hour value as a two-digit number in the range 00 to 23.<br />

Specifies the minute value as a two-digit number in the range 00 to 59.<br />

Specifies the seconds value as a two-digit number in the range 00 to 59.<br />

Specifies the milliseconds value as a three-digit number in the range 000 to 999.<br />

Examples The following example illustrates how to use the time literal format with an INSERT statement:<br />

INSERT INTO ttest VALUES ( { t '23:22:12' } ) ;<br />

The INSERT statements in the following example show some of the formats <strong>SQL</strong> will and will<br />

not accept for time literals:<br />

INSERT INTO T2 (C2) VALUES('3');<br />

error(-20234): Invalid time string<br />

INSERT INTO T2 (C2) VALUES('8:30');<br />

error(-20234): Invalid time string<br />

INSERT INTO T2 (C2) VALUES('8:30:1');<br />

INSERT INTO T2 (C2) VALUES('8:30:');<br />

error(-20234): Invalid time string<br />

INSERT INTO T2 (C2) VALUES('8:30:00');<br />

INSERT INTO T2 (C2) VALUES('8:30:1:1');<br />

INSERT INTO T2 (C2) VALUES({t'8:30:1:1'});<br />

The SELECT statement in the following example illustrates which INSERT statements<br />

successfully inserted a row:<br />

SELECT C2 FROM T2;c2<br />

c2<br />

--<br />

08:30:01<br />

08:30:00<br />

08:30:01<br />

08:30:01

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

Saved successfully!

Ooh no, something went wrong!