Table of Contents

Search

  1. Abstract
  2. Supported Versions
  3. Writing Custom Scripts to Run Batch Jobs

Writing Custom Scripts to Execute Batch Jobs

Writing Custom Scripts to Execute Batch Jobs

Sample Job Execution Script for Accept Non-matched Records As Unique

Sample Job Execution Script for Accept Non-matched Records As Unique

-- ACCEPT RECORDS ASSIGNED TO ALL USERS DECLARE V_ROWID_TABLE CHAR( 14 ); OUT_ACCEPT_UNIQUE_CNT INTEGER; OUT_ERROR_MESSAGE VARCHAR2( 1024 ); OUT_RETURN_CODE INTEGER; OUT_TMP_TABLE_LIST VARCHAR2(32000); BEGIN SELECT ROWID_TABLE INTO V_ROWID_TABLE FROM C_REPOS_TABLE WHERE TABLE_NAME = 'C_CUSTOMER'; CMXUT.ACCEPT_NON_MATCH_UNIQUE( V_ROWID_TABLE, NULL, 0, OUT_ACCEPT_UNIQUE_CNT, OUT_ERROR_MESSAGE, OUT_RETURN_CODE, OUT_TMP_TABLE_LIST ); DBMS_OUTPUT.PUT_LINE( 'NUMBER FOR RECORDS ACCEPTED AS UNIQUE: ' || OUT_ACCEPT_UNIQUE_CNT ); DBMS_OUTPUT.PUT_LINE( 'RETURN MESSAGE: ' || SUBSTR( OUT_ERROR_MESSAGE, 1, 255 )); DBMS_OUTPUT.PUT_LINE( 'RETURN CODE: ' || OUT_RETURN_CODE ); IF OUT_RETURN_CODE<0 THEN ROLLBACK; ELSE COMMIT; END IF; CMXUT.DROP_TABLE_IN_LIST(OUT_TMP_TABLE_LIST,OUT_ERROR_MESSAGE,OUT_RETURN_CODE); --Clean up temporary tables. END; / -- ACCEPT ONLY RECORDS ASSIGNED TO SPECIFIC USER DECLARE V_ROWID_TABLE CHAR( 14 ); V_ROWID_USER CHAR( 14 ); OUT_ACCEPT_UNIQUE_CNT INTEGER; OUT_ERROR_MESSAGE VARCHAR2( 1024 ); OUT_RETURN_CODE INTEGER; OUT_TMP_TABLE_LIST VARCHAR2(32000); BEGIN SELECT ROWID_TABLE INTO V_ROWID_TABLE FROM C_REPOS_TABLE WHERE TABLE_NAME = 'C_CUSTOMER'; SELECT ROWID_USER INTO V_ROWID_USER FROM C_REPOS_USER WHERE UPPER(USER_NAME) = 'ADMIN'; CMXUT.ACCEPT_NON_MATCH_UNIQUE( V_ROWID_TABLE, V_ROWID_USER, 1, OUT_ACCEPT_UNIQUE_CNT, OUT_ERROR_MESSAGE, OUT_RETURN_CODE, OUT_TMP_TABLE_LIST ); DBMS_OUTPUT.PUT_LINE( 'NUMBER FOR RECORDS ACCEPTED AS UNIQUE: ' || OUT_ACCEPT_UNIQUE_CNT ); DBMS_OUTPUT.PUT_LINE( 'RETURN MESSAGE: ' || SUBSTR( OUT_ERROR_MESSAGE, 1, 255 )); DBMS_OUTPUT.PUT_LINE( 'RETURN CODE: ' || OUT_RETURN_CODE ); IF OUT_RETURN_CODE<0 THEN ROLLBACK; ELSE COMMIT; END IF; CMXUT.DROP_TABLE_IN_LIST(OUT_TMP_TABLE_LIST,OUT_ERROR_MESSAGE,OUT_RETURN_CODE); --Clean up temporary tables. END; /

0 COMMENTS

We’d like to hear from you!