27.10.2013 Views

Jaybird 2.1 JDBC driver Java Programmer's Manual - Firebird

Jaybird 2.1 JDBC driver Java Programmer's Manual - Firebird

Jaybird 2.1 JDBC driver Java Programmer's Manual - Firebird

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.

{fn (argument list)}<br />

For example {fn concat('<strong>Firebird</strong>', '<strong>Java</strong>')} concatenates these two words<br />

into '<strong>Firebird</strong><strong>Java</strong>' literal. “Ошибка: источник перекрестной ссылки не<br />

найден” provides a list of supported scalar functions.<br />

Date and Time Literals<br />

It is allowed to include date and time literals in SQL statements. In order to<br />

guarantee that each database will interpret the literal identically, the <strong>JDBC</strong><br />

specification provides following syntax to specify them:<br />

Date literal escaped syntax:<br />

{d 'yyyy-mm-dd'}<br />

Time literal escaped syntax:<br />

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

Timestamp literal syntax (fractional seconds part '.f...' can be omitted):<br />

{ts 'yyyy-mm-dd hh:mm:ss.f...'}<br />

Outer Joins<br />

Due to the various approaches to specify outer joins (for instance, the Oracle “(+)”<br />

syntax), the <strong>JDBC</strong> specification provides the following syntax:<br />

{oj }<br />

where the outer join is specified as<br />

::=<br />

{LEFT|RIGHT|FULL} OUTER JOIN<br />

{ | } ON <br />

An example SQL statement would look like this:<br />

SELECT * FROM {oj tableA a<br />

LEFT OUTER JOIN tableB b ON a.id = b.id}<br />

Stored Procedures<br />

The escaped syntax for stored procedures is described in details in the XXX<br />

where CallableStatetent is covered.<br />

LIKE Escaped Characters<br />

The percent sign (%) and underscore (_) characters are wild cards in LIKE clause<br />

of the SQL statement. In order to interpret them literally they must be preceded by<br />

the backslash character (\) that is called the escape character. The escaped syntax<br />

for this case identifies which character is used as an escape character:<br />

{escape ''}<br />

Chapter 4. Executing statements 52

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

Saved successfully!

Ooh no, something went wrong!