<jsp:directive.page pageEncoding="UTF-8" />
<og:query command="{@command}" debug="{@debug}" maxRowCount="0" stopZero="true">
	select	TABLE_NAME,NAME_JA,count(*) AS CNT,SYSTEM_ID,'' AS UNIQ,'1' AS FGJ
	from GF80
	where SYSTEM_ID  = '{@SYSTEM_ID}'
	and   TBLSYU     = '{@TBLSYU}'
	<og:where startKey="and">
		<og:and value="TABLE_NAME like '{@TABLE_NAME}%'" />
		<og:and value="CLM        like '{@CLM}%'" />
	</og:where>
	and   FGJ		= '1'
	and (
		TABLE_NAME in (
			select TABLE_NAME from (
				select	TABLE_NAME
				from GF80
				where SYSTEM_ID  = '{@SYSTEM_ID}'
				and   TBLSYU     = '{@TBLSYU}'
				<og:where startKey="and">
					<og:and value="TABLE_NAME like '{@TABLE_NAME}%'" />
					<og:and value="CLM        like '{@CLM}%'" />
				</og:where>
				and   FGJ		= '1'
				group by TABLE_NAME,NAME_JA
			) B
			group by TABLE_NAME
			having count(*) > 1
		)
	--	or	( regexp_instr( NAME_JA , '[０-９Ａ-Ｚａ-ｚァ-ヶ]' ) > 0 )
		or	( regexp_instr( NAME_JA , '[０-９Ａ-Ｚａ-ｚ]' ) > 0 )
	)
	group by TABLE_NAME,NAME_JA,SYSTEM_ID
	order by TABLE_NAME,CNT,SYSTEM_ID
</og:query>

<og:hidden name="SQL" >
	UPDATE GF80 SET
			NAME_JA 	= [NAME_JA],
			COMMENTS	= '{@DATE.YMDF} {@LBL.@ACTION}',
			CDKH		= 'C',
			DYUPD		= '{@USER.YMDH}',
			USRUPD		= '{@USER.ID}',
			PGUPD		= '{@GUI.KEY}'
	WHERE SYSTEM_ID	= '{@SYSTEM_ID}'
	AND TBLSYU		= '{@TBLSYU}'
	AND TABLE_NAME	= [TABLE_NAME]
	AND FGJ			= '1'
</og:hidden>

<og:hidden name="noWritable">SYSTEM_ID,TABLE_NAME,CNT</og:hidden>
