How to identify the Firebird Server Operating System via SQL?

Asked

Viewed 308 times

2

In postgresql we have the table version where all the data I need will be in it. Ex.:

SQL:

Select * from version()

Upshot:

PostgreSQL 9.2.3 on x86_64-unknown-linux-gnu, compiled by gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064], 64-bit

There is something like this in Firebird, or something similar that returns the operating system and platform?

  • 1

    SELECT rdb$get_context('SYSTEM', 'ENGINE_VERSION') 
from rdb$database; will return the version for you, but I do not know if you have OS

  • 1

    Yeah, I had tested this, it returns only the version. but thanks.

1 answer

1


I used the following command to check the Operating System:

select rdb$get_context('SYSTEM', 'DB_NAME') from rdb$database

With this return, I can know if the platform is Windows or Linux:

Windows return:

c:/application/data/mydatabase.fdb

Retorno Linux:

/application/data/mydatabase.fdb

With this I can load my UDF(. dll/. so) created in C++ that allows me to execute commands in the system (cmd/prompt).

And with this guy I can get any information from the system.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.