<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<og:head headType="init" />
<og:comment
	system	= "GF:エンジンサンプル"
	pgid	= "GF2020"
	title	= "テーブルカラム"
	date	= "2008/10/27"
	author	= "Hiroki.Nakamura"
	text	= ""
	version	= "001"
/>

<!-- history.back() で戻るボタンを表示します。	-->
<jsp:directive.include file="/jsp/common/history_back.jsp" />

<og:columnCheck command = "{@command}" />
<og:entry command = "{@command}"  />

<og:dataCheck command="{@command}" exist="false" sqlType="{@sqlType}" execType="INSERT|COPY" msg="GFE0006">
	<jsp:text>
		select count(*) from GF05
		where SYSTEM_ID	= '{@MEM.SYSTEM_ID}'
		and TBLSYU		= '{@MEM.TBLSYU}'
		and CLM			= [CLM]
		and (	NAME_JA			!= [NAME_JA]
			or	CLS_NAME		!= [CLS_NAME]
			or	USE_LENGTH		!= [USE_LENGTH]
			or	DATA_DEFAULT	!= [DATA_DEFAULT]
			or	RENDERER		!= [RENDERER]
			or	EDITOR			!= [EDITOR]
			or	DBTYPE			!= [DBTYPE]
	<!--	or	COALESCE(BIKO,' ')	!= COALESCE([BIKO],' ') -->
			)
	</jsp:text>
</og:dataCheck>

<og:value command = "SETTBL" key = "TABLE_NAME" separator="','" action = "APPEND"/>

<og:equals val1="{@SQL2}" val2="{@SQL2}" >
  <og:tableUpdate
	command		= "{@command}"
	queryType	= "JDBCTableUpdate" >
  <jsp:text>{@SQL2}</jsp:text>
  </og:tableUpdate>
</og:equals>

<og:tableUpdate
	command		= "{@command}"
	queryType	= "JDBCTableUpdate" >
<jsp:text>{@SQL}</jsp:text>
</og:tableUpdate>

<!-- SEQNOの再セット -->
<og:query
	command		= "NEW"
	quotCheck	= "false">
	<jsp:text>
		SELECT UNIQ,SEQNO,SYSTEM_ID{@DBF.CON}'-'{@DBF.CON}TBLSYU{@DBF.CON}'-'{@DBF.CON}TABLE_NAME CLEAR_CLM
		FROM   GF05
		WHERE  SYSTEM_ID	= '{@MEM.SYSTEM_ID}'
		AND    TBLSYU		= '{@MEM.TBLSYU}'
		AND    TABLE_NAME	in ('{@TABLE_NAME}')
		ORDER BY  SYSTEM_ID,TBLSYU,TABLE_NAME,SEQNO
	</jsp:text>
</og:query>
<og:tableFilter classId="SEQRESET" keys="SEQ_CLM,CLEAR_CLM" vals="SEQNO,CLEAR_CLM" selectedAll="true" />
<og:tableUpdate
	command		= "{@command}"
	selectedAll = "true"
	queryType	= "JDBCTableUpdate" >
	<jsp:text>
		UPDATE GF05 SET
			SEQNO = [SEQNO]
		WHERE UNIQ = [UNIQ]
	</jsp:text>
</og:tableUpdate>

<og:forward page="result.jsp" keys="command" vals="RENEW" />
<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
