DECLARE SO_C_ADM CURSOR FOR SELECT OBJ_NAME, QRW_CREATOR, OBJ_SORT, ACCESS_MODE, COMM FROM QRWSYS.QRWSYS_OBJECT WHERE OBJ_NAME LIKE :H_NAME AND CREATOR = :H_AUTHID AND OBJ_TYPE = :H_TYPE AND ROWSQNR = :H_ROWSQNR AND FUNCTION_LEVEL <= :H_FUNCTION_LEVEL ORDER BY OBJ_NAME
DECLARE SO_C CURSOR FOR SELECT OBJ_NAME, QRW_CREATOR, OBJ_SORT, ACCESS_MODE, COMM FROM QRWSYS.QRWSYS_OBJECT WHERE OBJ_NAME LIKE :H_NAME AND CREATOR = :H_AUTHID AND OBJ_TYPE = :H_TYPE AND ROWSQNR = :H_ROWSQNR AND FUNCTION_LEVEL <= :H_FUNCTION_LEVEL AND (QRW_CREATOR = :H_QRW_AUTHID OR ACCESS_MODE <> 'P' ) ORDER BY OBJ_NAME
OPEN SO_C_ADM
OPEN SO_C
FETCH SO_C_ADM INTO :H_NAME, :H_QRW_AUTHID, :H_SORT, :H_ACCESS_MODE, :H_COMM
FETCH SO_C INTO :H_NAME, :H_QRW_AUTHID, :H_SORT, :H_ACCESS_MODE, :H_COMM
CLOSE SO_C_ADM
CLOSE SO_C
DECLARE SO_QLF CURSOR FOR SELECT CREATOR FROM QRWSYS.QRWSYS_OBJECT UNION SELECT CREATOR FROM SYSIBM.SYSTABLES