<jsp:directive.page pageEncoding="UTF-8" />
<!-- GFM0029 DB定義(ﾃｰﾌﾞﾙ名) ⇒ ﾗﾍﾞﾙﾘｿｰｽ差分追加 -->

<!-- KBCLM 6:除外 7:共通 8:有閑 9:削除 は対象外 -->
<og:query command="{@command}" debug="{@debug}" maxRowCount="0">
	select UPPER(TABLE_NAME) AS CLM,NAME_JA,0 as UNIQ,
			SYSTEM_ID || ' → ' || '{@SYSTEM_ID_R}' AS SYSTEM_ID,KBSAKU,SUBSYS
	from GE82
	where SYSTEM_ID = '{@SYSTEM_ID_D}'
	and   TBLSYU    = '{@TBLSYU}'
	<og:where startKey="and">
		<og:and value="TABLE_NAME like '{@TABLE_NAME}'"	/>
		<og:and value="KBSAKU     =    '{@KBSAKU}'"	/>
		<og:and value="SUBSYS     like '{@SUBSYS}'"	/>
	</og:where>
	and		KBCLM	< '6'
	and		FGJ		= '1'
	order by TABLE_NAME,SEQNO
</og:query>

<og:query command="{@command}" debug="{@debug}" dbid="{@DBID_R}" maxRowCount="0" scope="request">
	select CLM,NAME_JA,UNIQ,SYSTEM_ID,KBSAKU,SUBSYS
	from GEA08
	where SYSTEM_ID in ( '{@SYSTEM_ID_R}','**' )
	<og:where startKey="and">
		<og:and value="CLM like '{@CLM}'" />
	</og:where>
	and   LANG      = 'ja'
	and   FGJ       = '1'
	ORDER BY SYSTEM_ID DESC, KBSAKU DESC, CLM
</og:query>

<!-- CLMでグループ処理されます。先行優先 -->
<og:tableMerge
	action        = "MINUS"
	masterScope   = "session"
	masterKeys    = "CLM"
	slaveScope    = "request"
	display       = "true"
/>

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

<!-- KBLBL 2:ﾃｰﾌﾞﾙ -->
<og:hidden name="SQL">
	INSERT INTO GEA08
		(SYSTEM_ID,CLM,NAME_JA,LNAME,KBSAKU,SUBSYS,KBLBL,LANG,
		 FGJ,DYSET,DYUPD,USRSET,USRUPD,PGUPD)
	VALUES
		('{@SYSTEM_ID_R}',[CLM],[NAME_JA],[NAME_JA],[KBSAKU],[SUBSYS],'2','ja',
		 '1','{@USER.YMDH}','{@USER.YMDH}','{@USER.ID}','{@USER.ID}','{@GUI.KEY}')
</og:hidden>

<og:hidden name="DBID2" value="{@DBID_R}" />
