<jsp:directive.page pageEncoding="UTF-8" />
<!-- カラムリソース重複チェック 作成区分 除外 -->
<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	select
		CASE WHEN B.KBSAKU < A.KBSAKU THEN '0' ELSE '1' END AS writable ,
		B.CLM,
		CASE WHEN COALESCE(A.NAME_JA   ,'x') != COALESCE(B.NAME_JA   ,'x') THEN B.NAME_JA    || '→' || A.NAME_JA    ELSE '' END AS NAME_JA ,
		CASE WHEN COALESCE(A.CLS_NAME  ,'x') != COALESCE(B.CLS_NAME  ,'x') THEN B.CLS_NAME   || '→' || A.CLS_NAME   ELSE '' END AS CLS_NAME ,
		CASE WHEN COALESCE(A.USE_LENGTH,'x') != COALESCE(B.USE_LENGTH,'x') THEN B.USE_LENGTH || '→' || A.USE_LENGTH ELSE '' END AS USE_LENGTH ,
		CASE WHEN COALESCE(A.RENDERER  ,'x') != COALESCE(B.RENDERER  ,'x') THEN B.RENDERER   || '→' || A.RENDERER   ELSE '' END AS RENDERER ,
		CASE WHEN COALESCE(A.EDITOR    ,'x') != COALESCE(B.EDITOR    ,'x') THEN B.EDITOR     || '→' || A.EDITOR     ELSE '' END AS EDITOR ,
		CASE WHEN COALESCE(A.DBTYPE    ,'x') != COALESCE(B.DBTYPE    ,'x') THEN B.DBTYPE     || '→' || A.DBTYPE     ELSE '' END AS DBTYPE ,
		B.KBSAKU || '→' || A.KBSAKU as KBSAKU ,
		B.SYSTEM_ID || '→' || A.SYSTEM_ID as SYSTEM_ID ,
		B.SYSTEM_ID AS F_SYSTEM_ID, B.UNIQ
	from  GEA03 A inner join GEA03 B
					on    A.SYSTEM_ID = B.SYSTEM_ID
					and   A.CLM       = B.CLM
					and   A.UNIQ     != B.UNIQ
					and   A.KBSAKU   != B.KBSAKU
	where A.SYSTEM_ID IN ( '{@SYSTEM_ID}','{@BASE}','{@AST}' )
	<og:where startKey="and">
		<og:and value = "A.CLM like '{@CLM}'" />
	</og:where>
	and   A.FGJ       = '1'
	and   B.FGJ       = '1'
	order by B.SYSTEM_ID,B.CLM,B.UNIQ
</og:query>

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

<og:hidden name="SQL">
	DELETE FROM GEA03
	WHERE UNIQ      = [UNIQ]
	AND   SYSTEM_ID = [F_SYSTEM_ID]
	AND   CLM       = [CLM]
</og:hidden>

<og:viewLink command="{@command}">
	<og:link column="CLM" gamenId="GE0003" href="index.jsp" target="CONTENTS"
		keys="command,SYSTEM_ID,CLM,KBSAKU"
		vals="NEW,[F_SYSTEM_ID],[CLM],[KBSAKU]" />
</og:viewLink>
