Firebird 2.1 - Simple SELECT

南笙酒味 提交于 2019-12-20 03:29:26

问题


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!


回答1:


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)




回答2:


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.



来源:https://stackoverflow.com/questions/19789861/firebird-2-1-simple-select

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!