database:functions:pears_getdatabaseserverinfo



pears.GetDatabaseServerInfo

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

CREATE FUNCTION "pears"."GetDatabaseServerInfo"()
RETURNS long VARCHAR
/* Application Maintained Function / Procedure - DO NOT EDIT*/
BEGIN
  DECLARE "FileName" CHAR(200);
  DECLARE "rv" long VARCHAR;
  DECLARE @Platform CHAR(100);
  SET @Platform = (SELECT "property"('platform'));
  IF @Platform LIKE '%UNIX%' OR @Platform LIKE '%LINUX%' THEN
    SET "FileName" = "string"("replace"((SELECT "db_property"('file')),'IQX.db',''),'temp/SysInfo',"uniquekey"('A'),'.txt');
    CALL "xp_CmdShell"("string"('lscpu > ',"FileName"));
    CALL "xp_CmdShell"("string"('lsmem >> ',"FileName"))
  ELSE
    SET "FileName" = "string"((SELECT "xp_GetEnv"('TEMP')),'\\SysInfo',"UniqueKey"('A'),'.txt'); //IF TEMP NOT expanded OUT at this point xp_Read_File fails 
    CALL "xp_CmdShell"("string"('%SystemRoot%\\system32\\systeminfo.exe > ',"FileName"))
  END IF;
  SET "rv" = "xp_Read_File"("FileName");
  CALL "sp_Delete_File"("FileName");
  RETURN "rv"
END
  • database/functions/pears_getdatabaseserverinfo.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1