<jsp:directive.page pageEncoding="UTF-8" />
<og:query command="{@command}" debug="{@debug}" maxRowCount="0" stopZero="true">
	select	RENDERER,EDITOR,DBTYPE,
			'' as DTYPE,CLM,CLM_NAME,BIKO,
			CLS_NAME,USE_LENGTH,TABLE_NAME,NAME_JA,SEQNO,
			SYSTEM_ID,FGJ,UNIQ
	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   KBCLM     <= '7'
	and   FGJ		= '1'
	and (
		RENDERER is NULL or EDITOR is null or DBTYPE is null
		or	( CLS_NAME in ( 'NUMBER','DECIMAL','INTEGER' ) and DBTYPE not in ( 'S9' , 'R' ) )
		or  ( CLS_NAME like 'VARCHAR%' and DBTYPE in ( 'S9' , 'R' ) )
		or	(
			  (	RENDERER in ( 'MENU','DBMENU','CHBOX','DATALIST' )
			 or EDITOR   in ( 'MENU','DBMENU','CHBOX','DATALIST' ) )
			and BIKO IS NULL
		)
	)
	order by SYSTEM_ID,CLM,TABLE_NAME
</og:query>

<!-- UNIQ のみでユニークになるが、安全のため、SYSTEM_IDとTBLSYUだけは条件に加えておく -->
<og:hidden name="SQL" >
	UPDATE GF80 SET
			RENDERER	= [RENDERER],
			EDITOR		= [EDITOR],
			DBTYPE		= [DBTYPE],
			CLS_NAME	= [CLS_NAME],
			COMMENTS	= '{@DATE.YMDF} {@LBL.@ACTION}',
			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>

<og:hidden name="noWritable">SYSTEM_ID,TABLE_NAME,NAME_JA,SEQNO,CLM_NAME,CLM,DTYPE,USE_LENGTH,BIKO</og:hidden>
