Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: - determine Operating system using pl/sql??
Here's another hint :
Query DBA_DATA_FILES or V$DBFILE :
If the filename column starts with a letter followed by a ':' and a backslash, it is Win32. Otherwise, it is Unix (if these 2 O/S' are the only options!)
Create or replace function IsWin32 return boolean
is
Dummy binary_integer;
begin
select count(*)
into Dummy
from dba_data_files
where file_name like '_:\%';
return Dummy > 0;
end IsWin32;
Note that even though Oracle 8i and forward on Win32 accepts unix-like filename-notation in file-related commands, it is converted and recorded in the DD in WIN32-format:
SQL>select file_name from dba_data_files where tablespace_name = 'USERS'; FILE_NAME
SQL> select file_name from dba_data_files where tablespace_name = 'USERS'; FILE_NAME
On Wed, 28 Apr 2004 08:59:34 +0200, Herman de Boer <h.de.boer_at_YouCanGuessThis.com> wrote:
>Andre wrote:
>
>> Hello all,
>>
>> I've written a pl/sql package. Within this package I want to know if
>> the Operating system on which the Database is running is UNIX or
>> Windows-based.
>>
>> Is there a way to do this?
>>
>> regards,
>> Anneke
>> The Netherlands
>
>Hello Anneke,
>
>what about a simple:
>
>select dbms_utility.port_version from dual;
>
>
>
>
>--
>Kind Regards,
>
>Herman de Boer
>sr. Consultant, IT Consultancy group bv (itcg.nl)
Received on Wed Apr 28 2004 - 04:31:11 CDT