/**Begin D:\PDM_UPGRADE\PDM1\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_MEMBERPERM', 'T_EB_MEMBERPERM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MEMPERM_MEM') CREATE INDEX IDX_EB_MEMPERM_MEM ON T_EB_MEMBERPERM ( FMEMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MEMPERM_USER') CREATE INDEX IDX_EB_MEMPERM_USER ON T_EB_MEMBERPERM ( FUSERSID );


 EXEC P_ALTERPK 'PK_T_EB_MEMBERPERM_L', 'T_EB_MEMBERPERM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PERML_FK') CREATE INDEX IDX_EB_PERML_FK ON T_EB_MEMBERPERM_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_EB_MODELPERM', 'T_EB_MODELPERM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODEL_PERM') CREATE INDEX IDX_EB_MODEL_PERM ON T_EB_MODELPERM ( FMODELID );


 EXEC P_ALTERPK 'PK_T_EB_MODELPERM_L', 'T_EB_MODELPERM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODELPERM_L') CREATE INDEX IDX_EB_MODELPERM_L ON T_EB_MODELPERM_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_EB_MODELPERMENTRY', 'T_EB_MODELPERMENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODEL_PERMENTYR') CREATE INDEX IDX_EB_MODEL_PERMENTYR ON T_EB_MODELPERMENTRY ( FUSERS );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFAUDITTRIAL_L', 'T_EB_STRUCTOFAUDITTRIAL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AT_L') CREATE INDEX IDX_EB_AT_L ON T_EB_STRUCTOFAUDITTRIAL_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AT_L_NAME') CREATE INDEX IDX_EB_AT_L_NAME ON T_EB_STRUCTOFAUDITTRIAL_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFCURRENCY_L', 'T_EB_STRUCTOFCURRENCY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_L') CREATE INDEX IDX_EB_CURRENCY_L ON T_EB_STRUCTOFCURRENCY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_L_NAME') CREATE INDEX IDX_EB_CURRENCY_L_NAME ON T_EB_STRUCTOFCURRENCY_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFFY_L', 'T_EB_STRUCTOFFY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_L') CREATE INDEX IDX_EB_FY_L ON T_EB_STRUCTOFFY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_L_NAME') CREATE INDEX IDX_EB_FY_L_NAME ON T_EB_STRUCTOFFY_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFPERIOD_L', 'T_EB_STRUCTOFPERIOD_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PREIOD_L') CREATE INDEX IDX_EB_PREIOD_L ON T_EB_STRUCTOFPERIOD_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PREIOD_L_NAME') CREATE INDEX IDX_EB_PREIOD_L_NAME ON T_EB_STRUCTOFPERIOD_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFVERSION_L', 'T_EB_STRUCTOFVERSION_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFVERSION_L') CREATE INDEX IDX_EB_STRUCTOFVERSION_L ON T_EB_STRUCTOFVERSION_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STROFVERSION_L_NAME') CREATE INDEX IDX_EB_STROFVERSION_L_NAME ON T_EB_STRUCTOFVERSION_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFDEFINED_L', 'T_EB_STRUCTOFDEFINED_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_L') CREATE INDEX IDX_EB_UD_L ON T_EB_STRUCTOFDEFINED_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_L_NAME') CREATE INDEX IDX_EB_UD_L_NAME ON T_EB_STRUCTOFDEFINED_L ( FNAME ,FID );




 EXEC P_ALTERPK 'PK_T_EB_MODEL', 'T_EB_MODEL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODEL_NUM') CREATE INDEX IDX_EB_MODEL_NUM ON T_EB_MODEL ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_EB_USERSELECT', 'T_EB_USERSELECT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_USERSELECT') CREATE INDEX IDX_EB_USERSELECT ON T_EB_USERSELECT ( FMODELID ,FMODIFIERID ,FAPPLICATION );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFMETRIC_L', 'T_EB_STRUCTOFMETRIC_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFMETRIC_L') CREATE INDEX IDX_EB_STRUCTOFMETRIC_L ON T_EB_STRUCTOFMETRIC_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFCHANGETYPE_L', 'T_EB_STRUCTOFCHANGETYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_L') CREATE INDEX IDX_EB_CT_L ON T_EB_STRUCTOFCHANGETYPE_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_L_NAME') CREATE INDEX IDX_EB_CT_L_NAME ON T_EB_STRUCTOFCHANGETYPE_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFENT_L', 'T_EB_STRUCTOFENT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ENT_L') CREATE INDEX IDX_EB_ENT_L ON T_EB_STRUCTOFENT_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ENT_L_NAME') CREATE INDEX IDX_EB_ENT_L_NAME ON T_EB_STRUCTOFENT_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFICENTITY_L', 'T_EB_STRUCTOFICENTITY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ICE_L') CREATE INDEX IDX_EB_ICE_L ON T_EB_STRUCTOFICENTITY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ICE_L_NAME') CREATE INDEX IDX_EB_ICE_L_NAME ON T_EB_STRUCTOFICENTITY_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFFY', 'T_EB_STRUCTOFFY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_MODEL') CREATE INDEX IDX_EB_FY_MODEL ON T_EB_STRUCTOFFY ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_NUMBER') CREATE INDEX IDX_EB_FY_NUMBER ON T_EB_STRUCTOFFY ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_LONGNUM') CREATE INDEX IDX_EB_FY_LONGNUM ON T_EB_STRUCTOFFY ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_DIM') CREATE INDEX IDX_EB_FY_DIM ON T_EB_STRUCTOFFY ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_FY_PARENT') CREATE INDEX IDX_EB_FY_PARENT ON T_EB_STRUCTOFFY ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFICENTITY', 'T_EB_STRUCTOFICENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ICENTITY_LONGNUM') CREATE INDEX IDX_EB_ICENTITY_LONGNUM ON T_EB_STRUCTOFICENTITY ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ICENTITY_DIM') CREATE INDEX IDX_EB_ICENTITY_DIM ON T_EB_STRUCTOFICENTITY ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ICENTITY_PARENT') CREATE INDEX IDX_EB_ICENTITY_PARENT ON T_EB_STRUCTOFICENTITY ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFPERIOD', 'T_EB_STRUCTOFPERIOD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PREIOD_MODEL') CREATE INDEX IDX_EB_PREIOD_MODEL ON T_EB_STRUCTOFPERIOD ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PREIOD_NUMBER') CREATE INDEX IDX_EB_PREIOD_NUMBER ON T_EB_STRUCTOFPERIOD ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PERIOD_LONGNUM') CREATE INDEX IDX_EB_PERIOD_LONGNUM ON T_EB_STRUCTOFPERIOD ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PREIOD_DIM') CREATE INDEX IDX_EB_PREIOD_DIM ON T_EB_STRUCTOFPERIOD ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PREIOD_PARENT') CREATE INDEX IDX_EB_PREIOD_PARENT ON T_EB_STRUCTOFPERIOD ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFAUDITTRIAL', 'T_EB_STRUCTOFAUDITTRIAL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AT_MODEL') CREATE INDEX IDX_EB_AT_MODEL ON T_EB_STRUCTOFAUDITTRIAL ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AT_NUMBER') CREATE INDEX IDX_EB_AT_NUMBER ON T_EB_STRUCTOFAUDITTRIAL ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AUDITTTIAL_LONGNUM') CREATE INDEX IDX_EB_AUDITTTIAL_LONGNUM ON T_EB_STRUCTOFAUDITTRIAL ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AT_DIM') CREATE INDEX IDX_EB_AT_DIM ON T_EB_STRUCTOFAUDITTRIAL ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_AT_PARENT') CREATE INDEX IDX_EB_AT_PARENT ON T_EB_STRUCTOFAUDITTRIAL ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFCHANGETYPE', 'T_EB_STRUCTOFCHANGETYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_MODEL') CREATE INDEX IDX_EB_CT_MODEL ON T_EB_STRUCTOFCHANGETYPE ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_NUMBER') CREATE INDEX IDX_EB_CT_NUMBER ON T_EB_STRUCTOFCHANGETYPE ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CHANGETYPE_LONGNUM') CREATE INDEX IDX_EB_CHANGETYPE_LONGNUM ON T_EB_STRUCTOFCHANGETYPE ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_DIM') CREATE INDEX IDX_EB_CT_DIM ON T_EB_STRUCTOFCHANGETYPE ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_PARENT') CREATE INDEX IDX_EB_CT_PARENT ON T_EB_STRUCTOFCHANGETYPE ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFCURRENCY', 'T_EB_STRUCTOFCURRENCY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_MODEL') CREATE INDEX IDX_EB_CURRENCY_MODEL ON T_EB_STRUCTOFCURRENCY ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_NUMBER') CREATE INDEX IDX_EB_CURRENCY_NUMBER ON T_EB_STRUCTOFCURRENCY ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_LONGNUM') CREATE INDEX IDX_EB_CURRENCY_LONGNUM ON T_EB_STRUCTOFCURRENCY ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_DIM') CREATE INDEX IDX_EB_CURRENCY_DIM ON T_EB_STRUCTOFCURRENCY ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CURRENCY_PARENT') CREATE INDEX IDX_EB_CURRENCY_PARENT ON T_EB_STRUCTOFCURRENCY ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFENT', 'T_EB_STRUCTOFENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRONENT_LONGNUM') CREATE INDEX IDX_EB_STRONENT_LONGNUM ON T_EB_STRUCTOFENT ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ENT_MODEL') CREATE INDEX IDX_EB_ENT_MODEL ON T_EB_STRUCTOFENT ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ENT_NUMBER') CREATE INDEX IDX_EB_ENT_NUMBER ON T_EB_STRUCTOFENT ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ENT_DIM') CREATE INDEX IDX_EB_ENT_DIM ON T_EB_STRUCTOFENT ( FDIMENSIONID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFVERSION', 'T_EB_STRUCTOFVERSION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFVERSION_MODEL') CREATE INDEX IDX_EB_STRUCTOFVERSION_MODEL ON T_EB_STRUCTOFVERSION ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFVERSION_NUMBER') CREATE INDEX IDX_EB_STRUCTOFVERSION_NUMBER ON T_EB_STRUCTOFVERSION ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFVERSION_LONGNUM') CREATE INDEX IDX_EB_STRUCTOFVERSION_LONGNUM ON T_EB_STRUCTOFVERSION ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFVERSION_DIM') CREATE INDEX IDX_EB_STRUCTOFVERSION_DIM ON T_EB_STRUCTOFVERSION ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFVERSION_PARENT') CREATE INDEX IDX_EB_STRUCTOFVERSION_PARENT ON T_EB_STRUCTOFVERSION ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFDEFINED', 'T_EB_STRUCTOFDEFINED', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_MODEL') CREATE INDEX IDX_EB_UD_MODEL ON T_EB_STRUCTOFDEFINED ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_NUMBER') CREATE INDEX IDX_EB_UD_NUMBER ON T_EB_STRUCTOFDEFINED ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_LONGNUM') CREATE INDEX IDX_EB_UD_LONGNUM ON T_EB_STRUCTOFDEFINED ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_DIM') CREATE INDEX IDX_EB_UD_DIM ON T_EB_STRUCTOFDEFINED ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_UD_PARENT') CREATE INDEX IDX_EB_UD_PARENT ON T_EB_STRUCTOFDEFINED ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFMETRIC', 'T_EB_STRUCTOFMETRIC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_METRIC_MODEL') CREATE INDEX IDX_EB_METRIC_MODEL ON T_EB_STRUCTOFMETRIC ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_METRIC_NUMBER') CREATE INDEX IDX_EB_METRIC_NUMBER ON T_EB_STRUCTOFMETRIC ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_METRIC_LONGNUM') CREATE INDEX IDX_EB_METRIC_LONGNUM ON T_EB_STRUCTOFMETRIC ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_METRIC_DIM') CREATE INDEX IDX_EB_METRIC_DIM ON T_EB_STRUCTOFMETRIC ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_METRIC_PARENT') CREATE INDEX IDX_EB_METRIC_PARENT ON T_EB_STRUCTOFMETRIC ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_DIMENSION', 'T_EB_DIMENSION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DIM_MIDNUM') CREATE INDEX IDX_EB_DIM_MIDNUM ON T_EB_DIMENSION ( FMODELID , FNUMBER);





 EXEC P_ALTERPK 'PK_T_EB_BIZRULECATALOG', 'T_EB_BIZRULECATALOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BRCATA_MODEL') CREATE INDEX IDX_EB_BRCATA_MODEL ON T_EB_BIZRULECATALOG ( FMODELID );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULECATALOG_L', 'T_EB_BIZRULECATALOG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BRC_L') CREATE INDEX IDX_EB_BRC_L ON T_EB_BIZRULECATALOG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULEGLOBAL', 'T_EB_BIZRULEGLOBAL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BIZRULEGLO_MODEL') CREATE INDEX IDX_EB_BIZRULEGLO_MODEL ON T_EB_BIZRULEGLOBAL ( FMODELID );





 EXEC P_ALTERPK 'PK_T_EB_DIMENSION_L', 'T_EB_DIMENSION_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DIM_L') CREATE INDEX IDX_EB_DIM_L ON T_EB_DIMENSION_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DIM_L_FNAMEFID') CREATE INDEX IDX_EB_DIM_L_FNAMEFID ON T_EB_DIMENSION_L ( FNAME ,FID );


 EXEC P_ALTERPK 'PK_T_EB_MODEL_L', 'T_EB_MODEL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODEL_L') CREATE INDEX IDX_EB_MODEL_L ON T_EB_MODEL_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFACCOUNT', 'T_EB_STRUCTOFACCOUNT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_MODEL') CREATE INDEX IDX_EB_ACCOUNT_MODEL ON T_EB_STRUCTOFACCOUNT ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_NUMBER') CREATE INDEX IDX_EB_ACCOUNT_NUMBER ON T_EB_STRUCTOFACCOUNT ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_LONGNUM') CREATE INDEX IDX_EB_ACCOUNT_LONGNUM ON T_EB_STRUCTOFACCOUNT ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_DIM') CREATE INDEX IDX_EB_ACCOUNT_DIM ON T_EB_STRUCTOFACCOUNT ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_PARENT') CREATE INDEX IDX_EB_ACCOUNT_PARENT ON T_EB_STRUCTOFACCOUNT ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFACCOUNT_L', 'T_EB_STRUCTOFACCOUNT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_L') CREATE INDEX IDX_EB_ACCOUNT_L ON T_EB_STRUCTOFACCOUNT_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNT_L_NAME') CREATE INDEX IDX_EB_ACCOUNT_L_NAME ON T_EB_STRUCTOFACCOUNT_L ( FNAME );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BIZRULESET_ACC_ME') CREATE INDEX IDX_EB_BIZRULESET_ACC_ME ON T_EB_BIZRULESET ( FACCOUNTID ,FMETRICID );

 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFDATETYPE', 'T_EB_STRUCTOFDATETYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATETYPE_MODEL') CREATE INDEX IDX_EB_DATETYPE_MODEL ON T_EB_STRUCTOFDATETYPE ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATETYPE_DIM') CREATE INDEX IDX_EB_DATETYPE_DIM ON T_EB_STRUCTOFDATETYPE ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATETYPE_PARENT') CREATE INDEX IDX_EB_DATETYPE_PARENT ON T_EB_STRUCTOFDATETYPE ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFDATETYPE_L', 'T_EB_STRUCTOFDATETYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATETYPE_L') CREATE INDEX IDX_EB_DATETYPE_L ON T_EB_STRUCTOFDATETYPE_L ( FID ,FLOCALEID );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_STRUCTOFICENTITY_NUM') CREATE INDEX IDX_EB_STRUCTOFICENTITY_NUM ON T_EB_STRUCTOFICENTITY ( FNUMBER );

/**End D:\PDM_UPGRADE\PDM1\EB_constraint.sql **/
