Print Thread
Determining If 10g Installed?
#7742 08/29/05 07:10 PM
Joined: Oct 2001
Posts: 36
Glasgow
R
Member
OP Offline
Member
R
Joined: Oct 2001
Posts: 36
Glasgow
Is there any way of knowing if the user has 10g installed?

By using OracleCI we can check up to 9, but we need to find out if the user has 10 installed.

Thanks

Re: Determining If 10g Installed?
#7743 08/29/05 07:32 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Do you mean client or server?


Marco Kalter
Allround Automations
Re: Determining If 10g Installed?
#7744 08/29/05 08:48 PM
Joined: Oct 2001
Posts: 36
Glasgow
R
Member
OP Offline
Member
R
Joined: Oct 2001
Posts: 36
Glasgow
Ideally server, but client would do (if the user has a 10 client then the server will be 10). Prior to 10 we had a service that ran for updating Oracle Text indexes. On login to the program a warning would flash up if the service was not running. In 10 this service is not required so I don't want to run the check (the clients run instant client if this makes any difference).

Re: Determining If 10g Installed?
#7745 08/30/05 07:18 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
For the server you can test TOracleSession.ServerVersion, but it's easier to use the function below. It allows you to compare the returned string with a specific version.
Code
// Returns 6 digit 3 section version string, e.g. '09.02.00' for Oracle 9.2
function DBVersion(Session: TOracleSession): string;
var s, ds: string;
    p, digit: Integer;
begin
  Result := '';
  if Session.Connected then
  begin
    s := ' ' + UpperCase(Session.ServerVersion);
    p := Pos('RELEASE', s);
    if p <= 0 then
    begin
      p := Pos('.', s);
      while (p > 0) and (s[p] <> ' ') do Dec(p);
    end;
    if p > 0 then
    begin
      for digit := 1 to 3 do
      begin
        ds := '';
        while (p <= Length(s)) and not (s[p] in ['0'..'9']) do Inc(p);
        while (p <= Length(s)) and (s[p] in ['0'..'9']) do
        begin
          ds := ds + s[p];
          Inc(p);
        end;
        while Length(ds) < 2 do ds := '0' + ds;
        Result := Result + ds;
        if digit < 3 then Result := Result + '.';
      end;
    end;
  end;
end;


Marco Kalter
Allround Automations
Re: Determining If 10g Installed?
#7746 08/30/05 08:53 PM
Joined: Oct 2001
Posts: 36
Glasgow
R
Member
OP Offline
Member
R
Joined: Oct 2001
Posts: 36
Glasgow
Thanks very much Marco, that's exactly what I was after laugh


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.099s Queries: 14 (0.066s) Memory: 2.5152 MB (Peak: 3.0405 MB) Data Comp: Off Server Time: 2024-05-16 16:26:12 UTC
Valid HTML 5 and Valid CSS