The sqlLib.queryCurrentDatabase() system function returns the product and release number of the currently connected database. To determine the exact values different products return, see the product documentation, or run a local test.
sqlLib.queryCurrentDatabase(
product CHAR(8) inOut,
release CHAR(8) inOut)
The following example checks to ensure the database is the latest version:
dbName, dbVersion CHAR(8);
latestVersion CHAR(8) = "V9012";
errMsg STRING;
function main();
sqlLib.queryCurrentDatabase(dbName, dbVersion);
if (dbVersion != latestVersion)
errMsg = "Contact IT to get the latest version of " + dbName;
writeStderr (errMsg);
end
end