21.10.2013 Views

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

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.

Chapter 3<br />

Available in: DSQL, PSQL<br />

Added in: 1.0<br />

Changed in: 1.5<br />

Miscellaneous<br />

language elements<br />

-- (single-line comment)<br />

Description: A line starting with “--” (two dashes) is a comment and will be ignored. This also makes it easy<br />

to quickly comment out a line of SQL.<br />

In <strong>Firebird</strong> 1.5 and up, the “--” can be placed anywhere on the line, e.g. after an SQL statement. Everything<br />

from the double dash to the end of the line will be ignored.<br />

Example:<br />

-- a table to store our valued customers in:<br />

create table Customers (<br />

name varchar(32),<br />

added_by varchar(24),<br />

custno varchar(8),<br />

purchases integer -- number of purchases<br />

)<br />

Notice that the second comment is only allowed in <strong>Firebird</strong> 1.5 and up.<br />

Available in: DSQL, ESQL, PSQL<br />

Added in: IB<br />

Shorthand casts<br />

Description: When converting a string literal to a DATE, TIME or TIMESTAMP, <strong>Firebird</strong> allows the use of a<br />

shorthand “C-style” cast. This feature already existed in InterBase 6, but was never properly documented.<br />

Syntax:<br />

datatype 'date/timestring'<br />

7

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

Saved successfully!

Ooh no, something went wrong!