EXEC P_ALTERPK 'PK_T_PERMLOG_BUSITYPE', 'T_PERMLOG_BUSITYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERMLOG_BUSITYPE') CREATE UNIQUE INDEX IDX_PERMLOG_BUSITYPE ON T_PERMLOG_BUSITYPE ( FBUSITYPE );


EXEC P_ALTERPK 'PK_T_PERMLOG_BUSITYPE_L', 'T_PERMLOG_BUSITYPE_L', 'FPKID', '1';

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