Subject Re: [firebird-support] SQL Server Migration to Firebird
Author Ann W. Harrison
sqlsvr wrote:
> In SQL Server, you can do this in the Query Analazyer (which executes a query and displays the results):


> SELECT 'a' AS column1;

As far as I know, all Firebird tools require a FROM clause in every
SELECT statement, as the standard requires. If you want an arbitrary
single valued FROM source, you can use the system table RDB$DATABASE.

SELECT 'a' AS column1 from RDB$DATABASE;

>
> You can also do this:
> DECLARE @somevariable INT;
> SET @somevariable = 1;
> SELECT @somevariable;
>
> Can someone translate this to Firebird SQL?

Technically, Firebird SQL is the language available through
the API interface sometimes called DSQL. The capabilities
you're looking for are part of interpretive tools, of which
there are several. FlameRobin is one - it's a separate open
source project. The query interpreter that ships with
Firebird is ISQL which does not have variables. There's
an older and nearly unsupported tool called QLI which does
include variables. It doesn't use the "@" prefix. And, of
course, the last statement would be

SELECT somevariable FROM RDB$DATABASE;

Good luck,

Ann