要覆盖当前的SQL环境,改为使用作业 nnnnnn/QUSER/QZDASOINIT 的当前 *LIBL,可以按照以下步骤进行操作:
SELECT CURRENT_SERVER, CURRENT_SCHEMA, CURRENT_PATH FROM SYSIBM.SYSDUMMY1;
CREATE OR REPLACE VARIABLE OLD_SERVER VARCHAR(128);
CREATE OR REPLACE VARIABLE OLD_SCHEMA VARCHAR(128);
CREATE OR REPLACE VARIABLE OLD_PATH VARCHAR(8192);
SET OLD_SERVER = CURRENT_SERVER;
SET OLD_SCHEMA = CURRENT_SCHEMA;
SET OLD_PATH = CURRENT_PATH;
SET PATH = NULL;
SET CURRENT SERVER = 'nnnnnn';
SET CURRENT SCHEMA = 'QUSER';
SET CURRENT PATH = '';
-- 在此处执行你的SQL操作
-- 例如:
SELECT * FROM MYTABLE;
SET CURRENT SERVER = OLD_SERVER;
SET CURRENT SCHEMA = OLD_SCHEMA;
SET CURRENT PATH = OLD_PATH;
DROP VARIABLE OLD_SERVER;
DROP VARIABLE OLD_SCHEMA;
DROP VARIABLE OLD_PATH;
通过以上步骤,你可以覆盖当前的SQL环境,改为使用作业 nnnnnn/QUSER/QZDASOINIT 的当前 *LIBL 进行操作。请将 "nnnnnn" 替换为你实际的作业号。