__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
 WHERE SCRIPT_FILE_NAME = 'FW420_POSTDATA1.SQL'
   AND END_DTTM IS NOT NULL
/
__THEN__

__EXIT__

__ENDIF__

__IF_EXISTS__
SELECT 1
  FROM CI_INSTALL_PROD
 WHERE INSTALL_OPT_ID = '11111'
   AND OWNER_FLG = 'F1'
/
__ELSE__

__EXIT__

__ENDIF__


INSERT INTO F1_DB_OBJECTS_REPO(DB_OBJECT_NAME,SEQNO,OBJECT_TYPE,TBL_NAME,INDEXED_COLUMN,OWNER_FLG)  SELECT A.TRIGGER_NAME, 1, 'TRIGGER',  A.TABLE_NAME,  'N/A', B.OWNER_FLG FROM USER_TRIGGERS A, F1_INSTALLATION B WHERE A.TABLE_NAME NOT LIKE 'ZZ%' AND A.TABLE_NAME NOT LIKE '%$%' 
AND NOT EXISTS  (SELECT 1  FROM  F1_DB_OBJECTS_REPO C  WHERE UPPER(TRIM(C.DB_OBJECT_NAME)) = A.TRIGGER_NAME)
/


INSERT INTO F1_DB_OBJECTS_REPO(DB_OBJECT_NAME,SEQNO,OBJECT_TYPE,TBL_NAME,INDEXED_COLUMN,OWNER_FLG) SELECT SEQUENCE_NAME, 1, 'SEQUENCES', 'N/A', 'N/A',  B.OWNER_FLG FROM USER_SEQUENCES A, F1_INSTALLATION B WHERE NOT EXISTS   (SELECT 1   FROM F1_DB_OBJECTS_REPO B   WHERE UPPER(TRIM(B.DB_OBJECT_NAME)) = A.SEQUENCE_NAME )                                
/


INSERT INTO F1_DB_OBJECTS_REPO(DB_OBJECT_NAME,SEQNO,OBJECT_TYPE,TBL_NAME,INDEXED_COLUMN,OWNER_FLG)  SELECT INDEX_NAME, COLUMN_POSITION, 'INDEX',TABLE_NAME,COLUMN_NAME,B.OWNER_FLG FROM USER_IND_COLUMNS A, F1_INSTALLATION B WHERE A.TABLE_NAME NOT LIKE 'ZZ%' AND A.TABLE_NAME NOT LIKE '%$%'
AND A.COLUMN_NAME NOT LIKE '%$%' AND NOT EXISTS (SELECT 1 FROM F1_DB_OBJECTS_REPO B where UPPER(TRIM(B.DB_OBJECT_NAME)) = A.INDEX_NAME 
AND B.SEQNO = A.COLUMN_POSITION)           
/

update F1_EXTSYS_OUTMSG_PROF set DTTM_FORMAT_FLG = 'F1OU' where rtrim(DTTM_FORMAT_FLG) IS NULL 
/
