Anybody knows how to query/request programmatically the ODS version from the Firebird server, which will be used for new databases?
Asked
Active
Viewed 1,126 times
0
-
Did you see this question?http://stackoverflow.com/questions/9972580/which-version-of-interbase-or-firebird-was-a-database-created-under – John Easley Jul 06 '16 at 20:32
-
I don't know Delphi, but if you can execute a database information request (`isc_database_info`), then you can query for information items `isc_info_ods_version` and `isc_info_ods_minor_version`. – Mark Rotteveel Jul 07 '16 at 06:46
-
I was going to know the ODS version which will be used to create new databases (the ODS version of the server) and not the ODS version of an existing one. – LTi Jul 07 '16 at 10:59
3 Answers
1
In MON$DATABASE
you'll find MON$ODS_MAJOR
and MON$ODS_MINOR
in an existing database.

cincura.net
- 4,130
- 16
- 40
-
1But that assumes that the database is at minimum ODS 11.1, as `MON$DATABASE` was introduced in Firebird 2.1 (ODS 11.1). – Mark Rotteveel Jul 07 '16 at 08:41
-
that tells ODS of existing database, but the topicstarter requested one that "will be used for new databases" – Arioch 'The Jul 07 '16 at 19:10
-
Yes. You have to create dummy database (and then drop it). There's no way to know it upfront. It depends on various options that are known only when actually doing something. – cincura.net Jul 08 '16 at 09:30
0
Connect to any database that you can
Check the engine version - http://firebirdsql.su/doku.php?id=rdb_get_context
SELECT RDB$GET_CONTEXT('SYSTEM','ENGINE_VERSION') FROM RDB$DATABASE
Map the engine version to native ODS version using Firebird documentation or knowledge base articles like http://www.ibase.ru/prevver/

Arioch 'The
- 15,799
- 35
- 62
-
That is not going to work, because Firebird 2.5 and earlier will happily use older ODS versions, so engine version is not directly related to the ODS; it just puts a lower and upper limit on it. – Mark Rotteveel Jul 07 '16 at 05:11
-
1I just realised I misread the question, I thought it was about determining the ODS of an existing database, not for a new one. Unfortunately, the `RDB$GET_CONTEXT` trick will only work for Firebird 2.1 and later, and that you know the ODS mapping. – Mark Rotteveel Jul 07 '16 at 11:27
0
Since I have not found anything useful, I ended up creating a small function, which uses isql to create a bare bone database and extracts the ODS version with direct file access.
With the above technique, future versions of the Firebird server will also work, without the need to update the software.
Thanks for all the comments.

Mark Rotteveel
- 100,966
- 191
- 140
- 197

LTi
- 1
- 2
-
....assuming your user would have rights to create the database and the path for temp database would be allowed one. If your program can ensure those requirements, then it can work. – Arioch 'The Jul 07 '16 at 19:11