<jsp:directive.page pageEncoding="UTF-8" />
<og:query command="{@command}" debug="{@debug}" maxRowCount="0" stopZero="true" quotCheck="false" >
	select A.SYSTEM_ID,A.TBLSYU,A.TABLE_NAME,A.CLM,A.UNIQ,A.FGJ,A.FGCOM
	from  GF05 A
	where A.SYSTEM_ID = '{@SYSTEM_ID}'
	and   A.TBLSYU    = '{@TBLSYU}'
	and   exists (select 'X' from GF07 B
					where SYSTEM_ID  = B.SYSTEM_ID
					and A.TBLSYU	 = B.TBLSYU
					and A.TABLE_NAME = B.TABLE_NAME
					and A.CLM		 = B.CLM
					and B.FGJ       = '1'
	)
	<og:where startKey="and">
		<og:and value="A.TABLE_NAME like '{@TABLE_NAME}%'" />
		<og:and value="A.CLM        like '{@CLM}%'" />
	</og:where>
	and   A.FGJ       = '1'
--	and   A.FGCOM in ( '0','2' )			-- 0:初期 , 2:一般 を対象にする
	and   A.FGCOM    != '1'					-- 1:UK 以外を対象にする
	order by A.SYSTEM_ID,A.TBLSYU,A.TABLE_NAME,A.SEQNO
</og:query>

<og:value key="lblKey" value="C" />

<og:hidden name="names" value=",," />
<!-- 1:UK を設定する。 -->
<og:hidden name="SQL">
	UPDATE GF05 SET
			FGCOM		= '1',
			CDKH		= 'C',
			FGJ			= '1',
			DYUPD		= '{@USER.YMDH}',
			USRUPD		= '{@USER.ID}',
			PGUPD		= '{@GUI.KEY}'
	WHERE SYSTEM_ID	= '{@SYSTEM_ID}'
	AND   TBLSYU	= '{@TBLSYU}'
	AND   UNIQ		= [UNIQ]
</og:hidden>
