Steffen Goeldner wrote:
> 
> I think, all currently supported information types are
> stable across most Oracle releases. Other types may
> depend on a specific version, thus SQL_DBMS_VERSION is
> a top entry in the TODO list. I guess OCIServerVersion
> can help in obtaining the version number, however it
> returns the complete banner. I hope I find a reliable
> way to parse that string. Suggestions welcome!

I collected some alternatives to retrieve SQL_DBMS_VERSION:

 select * from v$version;

 select * from PRODUCT_COMPONENT_VERSION;

 set serveroutput on
 declare
   v varchar2(255);
   c varchar2(255);
 begin
   dbms_utility.db_version( v, c );
   dbms_output.put_line( v );
   dbms_output.put_line( c );
 end;
 /

 select dbms_utility.port_string from dual;

The attached file shows the results for Oracle8.
Unfortunately, I have no Oracle7 available. Is anybody so kind
and provides the results for Oracle7?

 
Steffen

[EMAIL PROTECTED]> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.2.1 - Production
PL/SQL Release 8.1.7.2.0 - Production
CORE    8.1.7.2.1       Production
TNS for 32-bit Windows: Version 8.1.7.2.0 - Production
NLSRTL Version 3.4.1.0.0 - Production

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> select * from PRODUCT_COMPONENT_VERSION;
rows will be truncated


PRODUCT                                                          VERSION
---------------------------------------------------------------- -------------
NLSRTL                                                           3.4.1.0.0
Oracle8i Enterprise Edition                                      8.1.7.2.1
PL/SQL                                                           8.1.7.2.0
TNS for 32-bit Windows:                                          8.1.7.2.0

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> set serveroutput on
[EMAIL PROTECTED]> declare
  2    v varchar2(255);
  3    c varchar2(255);
  4  begin
  5    dbms_utility.db_version( v, c );
  6    dbms_output.put_line( v );
  7    dbms_output.put_line( c );
  8  end;
  9  /
8.1.7.2.1
8.1.7.0.0

PL/SQL procedure successfully completed.

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> select dbms_utility.port_string from dual;

PORT_STRING
------------------------------------------------------------------------------
IBMPC/WIN_NT-8.1.0

Reply via email to