<?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	= "GF6130"
	title	= "左右分割スクロール"
	date	= "2008/10/27"
	author	= "Hiroki.Nakamura"
	text	= ""
	version	= "001"
/>

<!-- データが選ばれていなければエラー -->
<og:columnCheck command="{@command}" >
	<jsp:directive.include file="/jsp/common/history_back.jsp" />
</og:columnCheck>

<!-- ﾗﾍﾞﾙ区分 = 0:一般 -->
<og:query command="NEW" debug="{@debug}" dbid="{@MEM.TO_DBID}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		update GEA08 set KBLBL = '0'
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ = '1'
	</jsp:text>
</og:query>

<!-- ﾗﾍﾞﾙ区分 = 1:ｶﾗﾑ -->
<og:query command="NEW" debug="{@debug}" dbid="{@MEM.TO_DBID}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		update GEA08 set KBLBL = '1'
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ = '1'
		and   exists (
				select 'X' from GF05
				where GF05.SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
				and   GF05.FGJ = '1'
				and   GF05.CLM = GEA08.CLM )
	</jsp:text>
</og:query>

<!-- ﾗﾍﾞﾙ区分 = 2:ﾃｰﾌﾞﾙ -->
<og:query command="NEW" debug="{@debug}" dbid="{@MEM.TO_DBID}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		update GEA08 set KBLBL = '2'
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ = '1'
		and   exists (
				select 'X' from GF02
				where GF02.SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
				and   GF02.FGJ = '1'
				and   GF02.TABLE_NAME = GEA08.CLM )
	</jsp:text>
</og:query>

<!-- ﾗﾍﾞﾙ区分 = 3:画面 -->
<og:query command="NEW" debug="{@debug}" dbid="{@MEM.TO_DBID}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		update GEA08 set KBLBL = '3'
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ = '1'
		and   exists ( select 'X' from GEA11 
						where GEA11.SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
						and   GEA11.FGJ       = '1'
						and   GEA11.GUIKEY    = GEA08.CLM
					 )
	</jsp:text>
</og:query>

<!-- ﾗﾍﾞﾙ区分 = 4:画面分類 -->
<!--
<og:query command="NEW" debug="{@debug}" dbid="{@MEM.TO_DBID}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		update GEA08 set KBLBL = '4'
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ = '1'
		and   exists ( select 'X' from GEA11 
						where GEA11.SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
						and   GEA11.FGJ       = '1'
						and ( GEA11.CLASSIFY  = GEA08.CLM OR GEA11.GROUPS = GEA08.CLM )
					 )
	</jsp:text>
</og:query>
-->

<!-- ﾗﾍﾞﾙ区分 = 5:ﾌﾟﾛｸﾞﾗﾑ -->
<og:query command="NEW" debug="{@debug}" dbid="{@MEM.TO_DBID}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		update GEA08 set KBLBL = '5'
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ = '1'
		and   exists ( select 'X' from USER_OBJECTS 
						where USER_OBJECTS.OBJECT_NAME = GEA08.CLM
						and   USER_OBJECTS.OBJECT_TYPE not in ( 'TABLE','VIEW','INDEX' )
					 )
	</jsp:text>
</og:query>

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