 EXEC p_AlterPK 'PK_T_LOG_APP_V3', 'T_LOG_APP_V3', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_V3' AND KSQL_INDNAME = 'IDX_LOG_APP_V3_KEYWORD')
 CREATE INDEX IDX_LOG_APP_V3_KEYWORD ON T_LOG_APP_V3 (FKEYWORD );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_V3' AND KSQL_INDNAME = 'IDX_LOG_APP_V3_OPTIME')
 CREATE INDEX IDX_LOG_APP_V3_OPTIME ON T_LOG_APP_V3 (FOPTIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_V3' AND KSQL_INDNAME = 'IDX_LOG_APP_V3_USERID')
 CREATE INDEX IDX_LOG_APP_V3_USERID ON T_LOG_APP_V3 (FUSERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_V3' AND KSQL_INDNAME = 'IDX_LOG_APP_V3_OBJID')
 CREATE INDEX IDX_LOG_APP_V3_OBJID ON T_LOG_APP_V3 (FBIZOBJID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_V3' AND KSQL_INDNAME = 'IDX_LOG_APP_V3_EXT5')
 CREATE INDEX IDX_LOG_APP_V3_EXT5 ON T_LOG_APP_V3 (FEXT5 );


 EXEC p_AlterPK 'PK_LOG_APP_ARCHIVE_V3', 'T_LOG_APP_ARCHIVE_V3', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_ARCHIVE_V3' AND KSQL_INDNAME = 'IDX_LOG_ARCHIVEV3_KEYWORD')
 CREATE INDEX IDX_LOG_ARCHIVEV3_KEYWORD ON T_LOG_APP_ARCHIVE_V3 (FKEYWORD );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_ARCHIVE_V3' AND KSQL_INDNAME = 'IDX_LOG_ARCHIVEV3_OPTIME')
 CREATE INDEX IDX_LOG_ARCHIVEV3_OPTIME ON T_LOG_APP_ARCHIVE_V3 (FOPTIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_LOG_APP_ARCHIVE_V3' AND KSQL_INDNAME = 'IDX_LOG_ARCHIVEV3_USERID')
 CREATE INDEX IDX_LOG_ARCHIVEV3_USERID ON T_LOG_APP_ARCHIVE_V3 (FUSERID );


