<jsp:directive.page pageEncoding="UTF-8" />
<og:query command="{@command}" debug="{@debug}" maxRowCount="0" stopZero="true">
	select	DBTYPE,CLS_NAME,RENDERER,EDITOR,TABLE_NAME,NAME_JA,SEQNO,CLM_NAME,CLM,'' as DTYPE,
			PHY_LENGTH,USE_LENGTH,UK,LUK,IXA,IXB,IXC,IXD,IXE,IXF,IXG,IXH,IXI,IXJ,IXK,NOT_NULL,C_KEY,F_KEY,
			DATA_DEFAULT,KBCLM,BIKO,COMMENTS,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		<= '5'
	and   FGJ		= '1'
	and (
			( CLS_NAME in ( 'NUMBER' ,'DECIMAL' , 'INTEGER' ) and DBTYPE not in ( 'S9' , 'R' ) )
		or  ( CLS_NAME like 'VARCHAR%' and DBTYPE in ( 'S9' , 'R' ) )
	)
	order by SYSTEM_ID,CLM,TABLE_NAME
</og:query>

<!-- UNIQ のみでユニークになるが、安全のため、SYSTEM_IDとTBLSYUだけは条件に加えておく -->
<og:hidden name="SQL" >
	UPDATE GF80 SET
			NAME_JA 		= [NAME_JA],
			SEQNO			= [SEQNO],
			CLM_NAME		= [CLM_NAME],
			CLM 			= [CLM],
			CLS_NAME		= [CLS_NAME],
			PHY_LENGTH		= [PHY_LENGTH],
			USE_LENGTH		= [USE_LENGTH],
			UK				= [UK],
			LUK				= [LUK],
			IXA				= [IXA],
			IXB				= [IXB],
			IXC				= [IXC],
			IXD				= [IXD],
			IXE				= [IXE],
			IXF				= [IXF],
			IXG				= [IXG],
			IXH				= [IXH],
			IXI				= [IXI],
			IXJ				= [IXJ],
			IXK				= [IXK],
			NOT_NULL		= [NOT_NULL],
			C_KEY			= [C_KEY],
			F_KEY			= [F_KEY],
			RENDERER		= [RENDERER],
			EDITOR			= [EDITOR],
			DBTYPE			= [DBTYPE],
			DATA_DEFAULT	= [DATA_DEFAULT],
			KBCLM			= [KBCLM],
			BIKO			= [BIKO],
			COMMENTS		= [COMMENTS],
			CDKH			= 'C',
			FGJ				= '1',
			DYUPD			= '{@USER.YMDH}',
			USRUPD			= '{@USER.ID}',
			PGUPD			= '{@GUI.KEY}'
	WHERE UNIQ		= [UNIQ]
	AND   SYSTEM_ID	= '{@SYSTEM_ID}'
	AND   TBLSYU	= '{@TBLSYU}'
</og:hidden>

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