<?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="result" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />
<og:comment
	system	= "GF:エンジンサンプル"
	pgid	= "GF6250"
	title	= "EXCEL入力"
	date	= "2008/10/27"
	author	= "Hiroki.Nakamura"
	text	= ""
	version	= "001"
/>

<og:upload
	fileURL		= "{@USER.ID}"
/>

	<og:readTable
		readerClass		= "POI"
		command			= "{@command}"
		columns			= "TEXT,CMNT,SEQ"
		fileURL			= "{@USER.ID}"
		filename		= "{@FILE_01}"
		tableId			= "GF47_1"
		caseNN			= "{@FILE_01}"
		debug			= "{@debug}"
	/>

	<og:readTable
		readerClass		= "POI"
		command			= "{@command}"
		columns			= "TEXT,CMNT,SEQ"
		fileURL			= "{@USER.ID}"
		filename		= "{@FILE_02}"
		tableId			= "GF47_2"
		caseNN			= "{@FILE_02}"
		debug			= "{@debug}"
	/>

<og:transaction>
	<og:equals val1="{@FILE_01}" val2="{@FILE_01}" >
		<og:query command="NEW" >
			delete from GF47 where ID='{@ID_01}'
		</og:query>

		<og:tableFilter classId="SEQRESET" keys="SEQ_CLM,INCREMENT" vals="SEQ,1" selectedAll="true" tableId="GF47_1" />
		<og:tableUpdate command="ENTRY" selectedAll="true" queryType="JDBCTableUpdate" tableId="GF47_1" >
			<og:tableUpdateParam
				constObjKey = "null"
				sqlType		= "INSERT"
				constKeys	= "ID,FILE_NAME"
				constVals	= "{@ID_01},{@FILE_01}"
				table		= "GF47"
			/>
		</og:tableUpdate>
	</og:equals>

	<og:equals val1="{@FILE_02}" val2="{@FILE_02}" >
		<og:query command="NEW" >
			delete from GF47 where ID='{@ID_02}'
		</og:query>

		<og:tableFilter classId="SEQRESET" keys="SEQ_CLM,INCREMENT" vals="SEQ,1" selectedAll="true" tableId="GF47_2" />
		<og:tableUpdate command="ENTRY" selectedAll="true" queryType="JDBCTableUpdate" tableId="GF47_2" >
			<og:tableUpdateParam
				constObjKey = "null"
				sqlType		= "INSERT"
				constKeys	= "ID,FILE_NAME"
				constVals	= "{@ID_02},{@FILE_02}"
				table		= "GF47"
			/>
		</og:tableUpdate>
	</og:equals>
</og:transaction >

<og:query command="NEW">
	select * from GF47 where ID in ( '{@ID_01}' , '{@ID_02}' ) order by ID,SEQ
</og:query>

<form method="POST" action="forward.jsp" target="RESULT">
	<og:view
		viewFormType= "HTMLTable"
		command		= "{@command}"
		startNo		= "{@startNo}"
		pageSize	= "{@pageSize}" />
</form>

<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
