Rookee
Rookee

Reputation: 611

Firebird 2.1 - Simple SELECT

I would like to union some data, but a simple select example not working. Selecting existing tables work fine...

SELECT 1 as foo

Message:

can't format message 13:896 -- message file C:\xxxx\firebird.msg not found.
Dynamic SQL Error.
SQL error code = -104.
corrupt pool.

In MySQL and Postgres is no problem with these simple select..

Thanks for help!

Upvotes: 3

Views: 3034

Answers (2)

Michael Kazarian
Michael Kazarian

Reputation: 4462

It incorrect syntax for firebird. Right SELECT 1 as foo from RDB$DATABASE. RDB$DATABASE it system table for it RDBMS. You can read about FIREBIRD system tables here.

Upvotes: 3

user330315
user330315

Reputation:

Firebird (like many other DBMS) requires a FROM clause. In Oracle you'd use the DUAL table, in Firebird you can use RDB$DATABASE

SELECT 1 as foo
FROM RDB$DATABASE;

As RDB$DATABASE always contains exactly one row, this works the same way as Oracle's DUAL table (or IBM's SYSDUMMY)

Upvotes: 13

Related Questions