/**Begin D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210807\RIM_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_AIR_TAXORG') CREATE INDEX IDX_RIM_INV_AIR_TAXORG ON T_RIM_INV_AIR ( FTAX_ORG ,FTAX_PERIOD ,FINVOICE_DATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_RIM_INV_CUSTOM_NO') CREATE INDEX IDX_T_RIM_INV_CUSTOM_NO ON T_RIM_INV_CUSTOM ( FCUSTOM_DECLARATION_NO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_RIM_INV_CUSTOM_TAXORG') CREATE INDEX IDX_T_RIM_INV_CUSTOM_TAXORG ON T_RIM_INV_CUSTOM ( FTAX_ORG ,FTAX_PERIOD );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_GENERAL_TAXORG') CREATE INDEX IDX_RIM_INV_GENERAL_TAXORG ON T_RIM_INV_GENERAL ( FTAX_ORG ,FINVOICE_TYPE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_MOTOR_TAXORG') CREATE INDEX IDX_RIM_INV_MOTOR_TAXORG ON T_RIM_INV_MOTOR ( FTAX_ORG ,FTAX_PERIOD ,FDEDUCTION_PURPOSE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_ORDINARY_TAXORG') CREATE INDEX IDX_RIM_INV_ORDINARY_TAXORG ON T_RIM_INV_ORDINARY ( FTAX_ORG ,FTAX_PERIOD );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_QUOTA_TAXORG') CREATE INDEX IDX_RIM_INV_QUOTA_TAXORG ON T_RIM_INV_QUOTA ( FTAX_ORG );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_SPECIAL_TAXORG') CREATE INDEX IDX_RIM_INV_SPECIAL_TAXORG ON T_RIM_INV_SPECIAL ( FTAX_ORG ,FTAX_PERIOD ,FDEDUCTION_PURPOSE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TAX_PROOF_TAXORG') CREATE INDEX IDX_RIM_INV_TAX_PROOF_TAXORG ON T_RIM_INV_TAX_PROOF ( FTAX_ORG ,FINVOICE_DATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TAXI_TAXORG') CREATE INDEX IDX_RIM_INV_TAXI_TAXORG ON T_RIM_INV_TAXI ( FTAX_ORG ,FINVOICE_DATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TOLL_TAXORG') CREATE INDEX IDX_RIM_INV_TOLL_TAXORG ON T_RIM_INV_TOLL ( FTAX_ORG ,FTAX_PERIOD ,FDEDUCTION_PURPOSE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TRAIN_TAXORG') CREATE INDEX IDX_RIM_INV_TRAIN_TAXORG ON T_RIM_INV_TRAIN ( FTAX_ORG ,FTAX_PERIOD ,FINVOICE_DATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TRANSPORT_TAXORG') CREATE INDEX IDX_RIM_INV_TRANSPORT_TAXORG ON T_RIM_INV_TRANSPORT ( FTAX_ORG ,FTAX_PERIOD ,FINVOICE_DATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_USEDCAR_TAXORG') CREATE INDEX IDX_RIM_INV_USEDCAR_TAXORG ON T_RIM_INV_USEDCAR ( FTAX_ORG ,FTAX_PERIOD ,FDEDUCTION_PURPOSE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_ORG') CREATE INDEX IDX_RIM_INVOICE_ORG ON T_RIM_INVOICE ( FORG_ID );


/**End D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210807\RIM_constraint.sql **/
