Subject Re: [firebird-support] Book on T-SQL
Author Mark Rotteveel
On 18-4-2018 18:15, blackfalconsoftware@... [firebird-support]
wrote:
> One of the newer and nice error trapping features in T-SQL is the
> implementation of the "Try-Catch" block, which I used quite a bit when
> working on developing corporate databases.

That is supported in Firebird in `execute block` or in stored
procedures. The major difference with T-SQL is that T-SQL supports
stored procedure like usage without explicitly doing that. In Firebird
you're required to use a stored procedure (or wrap it in an execute block).

> Another was the use of "select" to to test out functionality.  for
> example, with T-SQL in a database manager I can write the following...
>
> select 'trailing ''la'''  -> which returns trailing 'la'  when run.
>
> You can do the same with the following Firebird-SQL statement...
>
>           select 'trailing ''la''' from RDB$DATABASE

A debatable difference: this is similar to Oracle's DUAL table. Also the
SQL standard requires a FROM-clause (this is an example where we are
strict ;).

> However, it took me a while to find this capability and I only did so by
> accident.  This is where a book on "Learning Firebird SQL" would of
> great assistance in moving the Firebird up the popularity rankings.  In
> fact, such books are far more helpful than the language references since
> these latter books assume that you have a working knowledge of SQL and
> do little to promote the Firebird database beyond the core community.

Writing a book is not easy, especially not for introductory texts.
However, we always welcome contributors for documentation. You can also
consider writing blog posts.

> As it regards the above example, if I remember correctly, I believe
> there is a similar statement construct in Oracle.
>
> However, the T-SQL implementation is the most elegant and the easiest to
> use and learn.
>
> Cursors in T-SQL have also gotten very powerful and even more efficient
> with the later releases of SQL Server.  As a result, their complexity is
> far easier to learn and use.
>
> As Oracle relies on cursors in a way that SQL Server does not, it is
> with this database engine that the power of the cursor is its most
> extensive.

Firebird also has cursors (in PSQL), but I have rarely needed to use
them explicitly (nor with Oracle or SQL Server). A good example of a use
case that is easy in another database, but hard to do in Firebird would
be really welcome.

> These are just some examples off the top of my head so to speak...

Thanks!


--
Mark Rotteveel