/**Begin D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HAOS_ADMINSTRUCT_L', 'T_HAOS_ADMINSTRUCT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_GROUP_L', 'T_HAOS_GROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_DEPARTMENT_L', 'T_HAOS_DEPARTMENT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_COMPANY_L', 'T_HAOS_COMPANY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORG_L', 'T_HAOS_ADMINORG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORG_A', 'T_HAOS_ADMINORG_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_ADMINORG_A') CREATE INDEX IDX_HAOS_ADMINORG_A ON T_HAOS_ADMINORG_A ( FTOBEDISABLEFLAG );


 EXEC P_ALTERPK 'PK_HAOS_ADMINORG', 'T_HAOS_ADMINORG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_DEPARTMENT', 'T_HAOS_DEPARTMENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_DEPARTMENT') CREATE INDEX IDX_HAOS_DEPARTMENT ON T_HAOS_DEPARTMENT ( FADMINORGID );


 EXEC P_ALTERPK 'PK_HAOS_GROUP', 'T_HAOS_GROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_GROUP') CREATE INDEX IDX_HAOS_GROUP ON T_HAOS_GROUP ( FADMINORGID );


 EXEC P_ALTERPK 'PK_HAOS_COMPANY', 'T_HAOS_COMPANY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_COMPANY_FID') CREATE INDEX IDX_HAOS_COMPANY_FID ON T_HAOS_COMPANY ( FADMINORGID );


 EXEC P_ALTERPK 'PK_HAOS_ADMINSTRUCT', 'T_HAOS_ADMINSTRUCT', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_ADMINSTRUCTORG') CREATE INDEX IDX_HAOS_ADMINSTRUCTORG ON T_HAOS_ADMINSTRUCT ( FADMINORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_ADMINSTRUCTSTRUCT') CREATE INDEX IDX_HAOS_ADMINSTRUCTSTRUCT ON T_HAOS_ADMINSTRUCT ( FSTRUCTLONGNUMBER );


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGTYPE', 'T_HAOS_ADMINORGTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGTYPE_L', 'T_HAOS_ADMINORGTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGTYPESTD', 'T_HAOS_ADMINORGTYPESTD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGTYPESTD_L', 'T_HAOS_ADMINORGTYPESTD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_SAFELEVEL', 'T_HAOS_SAFELEVEL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_SAFELEVEL_L', 'T_HAOS_SAFELEVEL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_SAFETYPE', 'T_HAOS_SAFETYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_SAFETYPE_L', 'T_HAOS_SAFETYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_COMPANYTYPE', 'T_HAOS_COMPANYTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_COMPANYTYPE_L', 'T_HAOS_COMPANYTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_INDUSTRYTYPE', 'T_HAOS_INDUSTRYTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_INDUSTRYTYPE_L', 'T_HAOS_INDUSTRYTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_DEPARTMENTTYPE', 'T_HAOS_DEPARTMENTTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_DEPARTMENTTYPE_L', 'T_HAOS_DEPARTMENTTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGCLASSIFY', 'T_HAOS_ADMINORGCLASSIFY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGCLASSIFY_L', 'T_HAOS_ADMINORGCLASSIFY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGFUNCTION', 'T_HAOS_ADMINORGFUNCTION', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGFUNCTION_L', 'T_HAOS_ADMINORGFUNCTION_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGSORTCODE', 'T_HAOS_ORGSORTCODE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_ORGSORTCODE') CREATE INDEX IDX_HAOS_ORGSORTCODE ON T_HAOS_ORGSORTCODE ( FADMINORGID );


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGLAYER', 'T_HAOS_ADMINORGLAYER', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ADMINORGLAYER_L', 'T_HAOS_ADMINORGLAYER_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_BASEDATALIST', 'T_HAOS_BASEDATALIST', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_BASEDATALIST_L', 'T_HAOS_BASEDATALIST_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGBUSINESSFILE', 'T_HAOS_ORGBUSINESSFILE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_ORGBUSINESSFILE') CREATE INDEX IDX_HAOS_ORGBUSINESSFILE ON T_HAOS_ORGBUSINESSFILE ( FADMINORGID );


 EXEC P_ALTERPK 'PK_HAOS_PROJTEAMSTRUCT_L', 'T_HAOS_PROJTEAMSTRUCT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJTEAMSTRUCT', 'T_HAOS_PROJTEAMSTRUCT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJTEAMSTRUCT') CREATE INDEX IDX_HAOS_PROJTEAMSTRUCT ON T_HAOS_PROJTEAMSTRUCT ( FSTRUCTLONGNUMBER );


 EXEC P_ALTERPK 'PK_HAOS_PROJTEAMBASE_L', 'T_HAOS_PROJTEAMBASE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJTEAMBASE', 'T_HAOS_PROJTEAMBASE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJSORTCODE', 'T_HAOS_PROJSORTCODE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJSORTCODE') CREATE INDEX IDX_HAOS_PROJSORTCODE ON T_HAOS_PROJSORTCODE ( FSORTCODE );


 EXEC P_ALTERPK 'PK_HAOS_ORGTEAM', 'T_HAOS_ORGTEAM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGTEAM_L', 'T_HAOS_ORGTEAM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGTEAMSTRUCT', 'T_HAOS_ORGTEAMSTRUCT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_OTSTRUCTORGTEAM') CREATE INDEX IDX_HAOS_OTSTRUCTORGTEAM ON T_HAOS_ORGTEAMSTRUCT ( FORGTEAMID );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_OTSTRUCTLONGNUMBER') CREATE INDEX IDX_HAOS_OTSTRUCTLONGNUMBER ON T_HAOS_ORGTEAMSTRUCT ( FSTRUCTLONGNUMBER );


 EXEC P_ALTERPK 'PK_HAOS_TEAMCOOPREL', 'T_HAOS_TEAMCOOPREL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_TEAMCOOPREL') CREATE INDEX IDX_HAOS_TEAMCOOPREL ON T_HAOS_TEAMCOOPREL ( FORGID );


 EXEC P_ALTERPK 'PK_HAOS_OTEVENT', 'T_HAOS_OTEVENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_OTEVENT') CREATE INDEX IDX_HAOS_OTEVENT ON T_HAOS_OTEVENT ( FEVENTTYPE );


 EXEC P_ALTERPK 'PK_HAOS_OTBUSIEVENTREL', 'T_HAOS_OTBUSIEVENTREL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_OTBUSIEVENTREL') CREATE INDEX IDX_HAOS_OTBUSIEVENTREL ON T_HAOS_OTBUSIEVENTREL ( FBOID );


 EXEC P_ALTERPK 'PK_HAOS_OTEVENTRELHIS', 'T_HAOS_OTEVENTRELHIS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_OTEVENTRELHIS') CREATE INDEX IDX_HAOS_OTEVENTRELHIS ON T_HAOS_OTEVENTRELHIS ( FBUSIEVENTID );


 EXEC P_ALTERPK 'PK_HAOS_ORGCHANGETYPE', 'T_HAOS_ORGCHANGETYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGCHANGETYPE_L', 'T_HAOS_ORGCHANGETYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGCHANGEREASON', 'T_HAOS_ORGCHANGEREASON', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_ORGCHANGEREASON_L', 'T_HAOS_ORGCHANGEREASON_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_OTCLASSIFY', 'T_HAOS_OTCLASSIFY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_OTCLASSIFY_L', 'T_HAOS_OTCLASSIFY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_TEAMCOOPRELTYPE_L', 'T_HAOS_TEAMCOOPRELTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_TEAMCOOPRELTYPE', 'T_HAOS_TEAMCOOPRELTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_COOPOTCLASSIFY', 'T_HAOS_COOPOTCLASSIFY', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_COOPOTCLASSIFY') CREATE INDEX IDX_HAOS_COOPOTCLASSIFY ON T_HAOS_COOPOTCLASSIFY ( FID );


 EXEC P_ALTERPK 'PK_HAOS_COMMBASEDATALIST', 'T_HAOS_COMMBASEDATALIST', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_COMMBASEDATALIST_L', 'T_HAOS_COMMBASEDATALIST_L', 'FPKID', '1';

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



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