Determining If 10g Installed?

Robertio

Member²
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
 
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).
 
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;
 
Back
Top