Re: How can you tell which operating system you ar on from PL/Sql?

From: Dean Dashwood <dd_at_langley.softwright.co.uk>
Date: 1997/09/12
Message-ID: <874053218.22596_at_dejanews.com>#1/1


Hmm - that's a difficult one. I can't see any reason why *anything* should run differently depending on the operating system. Are you talking about the server or the client OS? Also, where are you running your PL/Sql from? For example, are you running it from Sql*Plus, or calling it from a 3GL?

I can't think of any way of finding out what operating system the server is running on. But if it's the client you're interested in, you could try doing some clever tricks from the client software.

Here's the kind of thing I'm thinking of. If you're running from Sql*Plus, place a file (OS.sql) in the current directory. The contents of the file would look something like this:

var os varchar2(20)
execute :os := 'NT4'

(depending on what OS you're on). Then, execute this from Sql*Plus by typing

_at_OS

And from your PL/Sql you could do something like:

if :os = 'NT4' then
  .....
else
 .....

etc. etc.

Likewise, you could do something similar in Pro*C or OCI - set a host variable, or pass a parameter in to the stored procedure.

Hope that helps.

Dean


In article <34182CDD.4F93_at_vitek.com>,   vahidt_at_vitek.com wrote:
>
>
> I wonder if it is possible to tell the operation system (NT4.0, AIX ..)
> you are on from PL/Sql. I use UTL_FILE and it behaves differently on
> NT4.0 than AIX. Thanks.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Fri Sep 12 1997 - 00:00:00 CEST

Original text of this message