Subject Re: [Firebird-general] OT Non-Firebird - braces as outer join escape sequence
Author Mark Rotteveel
> I recently ran across this syntax. (Note {oj ...}
>
>
> SELECT Customers.CustID, Customers.Name, Orders.OrderID, Orders.Status
> FROM {oj Customers LEFT OUTER JOIN Orders ON
> Customers.CustID=Orders.CustID}
> WHERE Orders.Status='OPEN'
>
> It seems to be equivalent to
>
>
> SELECT Customers.CustID, Customers.Name, Orders.OrderID, Orders.Status
> FROM Customers LEFT OUTER JOIN Orders ON Customers.CustID=Orders.CustID
> WHERE Orders.Status='OPEN'
>
> Any idea what that's about and whether there's a difference between the
> two?

Looks like the ODBC escape syntax to me. It is intended for language constructs that are either not formalised, or where databases sometimes have their own (historic) syntax and not standardised (SQL) syntax. The escape syntax means the driver will need to translate the escaped construct (which is also defined in ODBC) to the construct supported by the database (or in some cases: let the database handle it by itself). The idea is that this would make it easier to create database indepent code.

See also http://msdn.microsoft.com/en-us/library/ms711838%28v=vs.85%29.aspx

I am not sure, but it might also be specified in the SQL/CLI specs. JDBC drivers are also required to support a subset of the ODBC escape syntax btw (at least for some of the scalar functions).
--
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl