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

__IF_EXISTS__
SELECT 1 FROM CI_MD_SVC A WHERE TRIM(A.APP_SVC_ID) IS NULL AND EXISTS (SELECT 'X' FROM SC_APP_SERVICE B WHERE B.APP_SVC_ID = A.SVC_NAME)
/
__THEN__
UPDATE CI_MD_SVC A SET A.APP_SVC_ID = A.SVC_NAME WHERE EXISTS (SELECT 'X' FROM SC_APP_SERVICE B WHERE B.APP_SVC_ID = A.SVC_NAME)
/
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM CI_MD_SVC A WHERE TRIM(A.APP_SVC_ID) IS NULL AND NOT EXISTS (SELECT 'X' FROM SC_APP_SERVICE B WHERE B.APP_SVC_ID = A.SVC_NAME)
/
__THEN__
UPDATE CI_MD_SVC A SET A.APP_SVC_ID = 'F1-DFLTS' WHERE NOT EXISTS (SELECT 'X' FROM SC_APP_SERVICE B WHERE B.APP_SVC_ID = A.SVC_NAME)
/
__ENDIF__