modius modius - 1 month ago 6x
SQL Question

How can I confirm a database is Oracle & what version it is using SQL?

I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Oracle, and if possible, what version of Oracle they are running by sending a SQL statement to the datasource.


Run this SQL:

select * from v$version;

And you'll get a result like:

Oracle Database 10g Release - 64bit Production
PL/SQL Release - Production
CORE      Production
TNS for Solaris: Version - Production
NLSRTL Version - Production