Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateMiscellaneous language elements → Shorthand casts
Firebird Home Firebird Home Prev: -- (single-line comment)Firebird Documentation IndexUp: Miscellaneous language elementsNext: CASE construct

Shorthand casts

Tip

Find a more recent version at Firebird 5.0 Language Reference: Datetime Literals

Available in: DSQL, ESQL, PSQL

Added in: IB

Description: When converting a string literal to a DATE, TIME or TIMESTAMP, Firebird allows the use of a shorthand C-style cast. This feature already existed in InterBase 6, but was never properly documented.

Syntax: 

datatype 'date/timestring'

Examples: 

update People set AgeCat = 'Old'
  where BirthDate < date '1-Jan-1943'
insert into Appointments
  (Employee_Id, Client_Id, App_date, App_time)
values
  (973, 8804, date 'today' + 2, time '16:00')
new.lastmod = timestamp 'now';

See also: CAST

Prev: -- (single-line comment)Firebird Documentation IndexUp: Miscellaneous language elementsNext: CASE construct
Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateMiscellaneous language elements → Shorthand casts