Infolinks

Monday, 24 September 2012

Sample script to insert secondary price lists to the primary price list

Sample script to insert secondary price lists to the primary price list


Sample script to insert secondary price lists to the primary price list with
 mandatory columns to be populated in the following bulk loader interface tables:
 QP_INTERFACE_LIST_HEADERS
 QP_INTERFACE_QUALIFIERS

 This script assumes that both primary price list and the secondary price lists
 have been created already and exist. This script populates
 * QP_INTERFACE_LIST_HEADERS table with ORIG_SYS_HEADER_REF of the secondary price list.
 * QP_INTERFACE_QUALIFIERS table with primary price list Name in
      QUALIFIER_ATTR_VALUE_CODE. Alternatively populate primary price list header id in
      QUALIFIER_ATTRIBUTE_CODE.




/* Attach two secondary price lists to the Sample_BLK_PL price list.*/
/* Attach Secondary Price List 1 */
INSERT INTO QP_INTERFACE_LIST_HEADERS (
ORIG_SYS_HEADER_REF,
LIST_TYPE_CODE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
INTERFACE_ACTION_CODE,
PROCESS_FLAG,
PROCESS_STATUS_FLAG,
REQUEST_ID,
PROCESS_ID
) VALUES (
'SAMPLE_HEADER11',        /* ORIG_SYS_HEADER_REF of the secondary price list to be attached.*/
'PRL',                    /* List Type Code */
1318,                     /* Last Updated By */
sysdate,                  /* Last Update Date */
'UPDATE',                 /* Interface Action Code. The possible values are INSERT/UPDATE/DELETE.*/
'Y',                      /* Process Flag */
'P',                      /* Process Status Flag */
NULL,                     /* Request Id */
999                       /* Process Id */
);

INSERT INTO QP_INTERFACE_QUALIFIERS (
ORIG_SYS_QUALIFIER_REF,
ORIG_SYS_HEADER_REF,
QUALIFIER_GROUPING_NO,
QUALIFIER_CONTEXT,
QUALIFIER_ATTRIBUTE_CODE,
QUALIFIER_ATTR_VALUE_CODE,
COMPARISON_OPERATOR_CODE,
QUALIFIER_PRECEDENCE,
INTERFACE_ACTION_CODE,
PROCESS_FLAG,
PROCESS_STATUS_FLAG,
PROCESS_ID
) VALUES (
'SAMPLE_QUAL11',          /* ORIG_SYS_QUALIFIER_REF */
'SAMPLE_HEADER11',        /* ORIG_SYS_HEADER_REF of the secondary price list.*/
-1,                       /* Qualifier Grouping No */
'MODLIST',                /* Qualifier Context */
'PRICE_LIST',             /* Qualifier Attribute Code */
'Sample_BLK_PL',          /* Qualifier Attribute Value Code. Primary Price List Name.*/
'=',                      /* Comparison Operator Code */
100,                      /* Qualifier Precedence */
'INSERT',                 /* Interface Action Code. The possible values are INSERT/UPDATE/DELETE.*/
'Y',                      /* Process Flag */
'P',                      /* Process Status Flag */
999                       /* Process Id */
);

/* Attach Secondary Price List 2.*/
INSERT INTO QP_INTERFACE_LIST_HEADERS (
ORIG_SYS_HEADER_REF,
LIST_TYPE_CODE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
INTERFACE_ACTION_CODE,
PROCESS_FLAG,
PROCESS_STATUS_FLAG,
REQUEST_ID,
PROCESS_ID
) VALUES (
'SAMPLE_HEADER2012',        /* ORIG_SYS_HEADER_REF of the secondary price list.*/
'PRL',                    /* List Type Code */
1318,                     /* Last Updated By */
sysdate,                  /* Last Update Date */
'UPDATE',                 /* Interface Action Code. The possible values are INSERT/UPDATE/DELETE.*/
'Y',                      /* Process Flag */
'P',                      /* Process Status Flag */
NULL,                     /* Request Id */
999                       /* Process Id */
);

INSERT INTO QP_INTERFACE_QUALIFIERS (
ORIG_SYS_QUALIFIER_REF,
ORIG_SYS_HEADER_REF,
QUALIFIER_GROUPING_NO,
QUALIFIER_CONTEXT,
QUALIFIER_ATTRIBUTE_CODE,
QUALIFIER_ATTR_VALUE_CODE,
COMPARISON_OPERATOR_CODE,
QUALIFIER_PRECEDENCE,
INTERFACE_ACTION_CODE,
PROCESS_FLAG,
PROCESS_STATUS_FLAG,
PROCESS_ID
) VALUES (
'SAMPLE_QUALIFIER',          /* ORIG_SYS_QUALIFIER_REF */
'SAMPLE_HEADER2012',        /* ORIG_SYS_HEADER_REF of the secondary price list.*/
-1,                       /* Qualifier Grouping No */
'MODLIST',                /* Qualifier Context */
'PRICE_LIST',             /* Qualifier Attribute Code */
'Sample_BLK_PL',          /* Qualifier Attribute Value Code. Primary Price List Name.*/
'=',                      /* Comparison Operator Code */
100,                      /* Qualifier Precedence */
'INSERT',                 /* Interface Action Code. The possible values are INSERT/UPDATE/DELETE.*/
'Y',                      /* Process Flag */
'P',                      /* Process Status Flag */
999                       /* Process Id */                      
);

COMMIT;
EXIT;

No comments:

Post a Comment