<og:query command="NEW" debug="{@debug}" notfoundMsg="" >
		DELETE FROM GF05
		WHERE SYSTEM_ID = '{@SYSTEM_ID}'
		AND   TBLSYU    = '{@TBLSYU}'
	<og:where startKey="and">
		<og:and value = "TABLE_NAME like '{@TABLE_NAME}%'" />
	</og:where>
</og:query>

<og:query command="NEW" dbid="{@DBID}" debug="{@debug}" maxRowCount="100000">
		select TABLE_NAME,COLUMN_NAME AS CLM,COLUMN_ID AS SEQNO,COLUMN_NAME AS NAME_JA,
			DATA_TYPE AS CLS_NAME,
			( CASE WHEN DATA_PRECISION IS NULL 
						THEN to_char(DATA_LENGTH)
						ELSE (	CASE WHEN DATA_SCALE = 0 
									THEN to_char(DATA_PRECISION)
									ELSE DATA_PRECISION || ',' || DATA_SCALE
							  	END )
					 END ) AS USE_LENGTH ,
			DATA_DEFAULT ,
		    (CASE NULLABLE WHEN 'Y' THEN null WHEN 'N' THEN '1' END) AS NOT_NULL,
			'0' AS FGCOM, '' AS BIKO,'' AS RENDERER,'' AS EDITOR,'' AS DBTYPE,
			'{@SYSTEM_ID}' AS SYSTEM_ID,
			'{@TBLSYU}' AS TBLSYU
		from USER_TAB_COLUMNS
		where exists ( select 'X' from USER_TABLES
						where USER_TABLES.TABLE_NAME = USER_TAB_COLUMNS.TABLE_NAME
						and   USER_TABLES.TABLESPACE_NAME IS NOT NULL
					)
		<og:where startKey="and">
			<og:and value = "TABLE_NAME like '{@TABLE_NAME}%'" />
			<og:and value = "INSTR(TABLE_NAME,'$') < 1" />
		</og:where>
		order by TABLE_NAME,COLUMN_ID
</og:query>

<og:tableUpdate
	command		= "ENTRY"
	queryType	= "JDBCTableUpdate"
	selectedAll = "true"
	displayMsg  = "MSG0040"
>
	INSERT INTO GF05
		(TABLE_NAME,CLM,SEQNO,NAME_JA,CLS_NAME,USE_LENGTH,
		 DATA_DEFAULT,NOT_NULL,
		 RENDERER,EDITOR,DBTYPE,BIKO,SYSTEM_ID,FGCOM,TBLSYU,
		 CDKH,FGJ,DYSET,DYUPD,USRSET,USRUPD,PRGUPD)
	VALUES
		([TABLE_NAME],[CLM],[SEQNO],[NAME_JA],[CLS_NAME],[USE_LENGTH],
		  DATA_DEFAULT([DATA_DEFAULT]),[NOT_NULL],
		  [RENDERER],[EDITOR],[DBTYPE],[BIKO],[SYSTEM_ID],[FGCOM],[TBLSYU],
		 'A','1','{@USER.YMDH}','{@USER.YMDH}','{@USER.ID}','{@USER.ID}','{@GUI.KEY}')
</og:tableUpdate>
