Tommi Prami wrote:
Is there some simple select SQL I can verify that server is Firebird/Interbase and if Firebird which version of it? Some selects to the RDB$ tables maybe...
Sean Leyne answers:
In v2.1 there is a new RDB$GET_Context call which will return the Firebird version.
In older versions there is no definitive way to determine the version, though there are some clues which can be used to give you some general idea of the version (If RDB$GET_Context is defined as UDF, then version is 2.x else version 1.x. Further if RDB$GET_Context( 'System','ODS') = 11.1 then version = 2.1 else 2.0.x)
Milan Babuskov adds:
To identify 1.x FB/IB you could maybe test some features and see if queries fail. For example:
select coalesce(1, 0) from rdb$database
would fail in Firebird 1.0, and:
execute block as begin end
would fail in Firebird 1.5 and (as already explained), you can use RDB$GET_Context to determine whether it's FB 2.0 or 2.1
Of course, catch the error code to be sure it didn't fail for some other reason (bad password, network problem, etc.).