<jsp:directive.page pageEncoding="UTF-8" />
<og:query command="{@command}" debug="{@debug}" dbid="{@DBID_R}" maxRowCount="0">
	select '1' WRITABLE, CLM, NAME_JA, UNIQ,SYSTEM_ID
	from GEA08
	where SYSTEM_ID in ( '{@SYSTEM_ID_R}','**' )
	<og:where startKey="and">
		<og:and value="CLM like '{@CLM_R}%'" />
	</og:where>
	and   LANG      = 'ja'
	and   FGJ       = '1'
	ORDER BY SYSTEM_ID DESC, KBSAKU DESC, CLM
</og:query>

<og:query command="{@command}" debug="{@debug}" maxRowCount="0" scope="request">
	select '0' WRITABLE, UPPER(TABLE_NAME) AS CLM,NAME_JA,UNIQ,SYSTEM_ID
	from GF02
	where SYSTEM_ID = '{@SYSTEM_ID_D}'
	and   TBLSYU    = '{@TBLSYU_D}'
	<og:where startKey="and">
		<og:and value="TABLE_NAME like '{@TABLE_NAME_D}%'"	/>
	</og:where>
	and   FGJ       = '1'
	order by TABLE_NAME
</og:query>

<og:tableMerge
	action        = "DIFFERENCE"
	masterScope   = "session"
	masterKeys    = "CLM"
	diffKeys      = "CLM,NAME_JA"
	slaveScope    = "request"
	modifyClms    = "UNIQ"
	display       = "true"
/>

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

<!-- UNIQ のみでユニークになるが、安全のため、SYSTEM_IDとTBLSYU_D,TABLE_NAME(CLM) だけは条件に加えておく -->
<og:hidden name="SQL">
	UPDATE GF02 SET
		NAME_JA		= [NAME_JA],
		DYUPD		= '{@USER.YMDH}',
		USRUPD		= '{@USER.ID}',
		PGUPD		= '{@GUI.KEY}'
	WHERE	UNIQ		= [UNIQ]
	AND		SYSTEM_ID	= '{@SYSTEM_ID_D}'
	AND		TBLSYU		= '{@TBLSYU_D}'
	AND		TABLE_NAME	= [CLM]
</og:hidden>
