<jsp:directive.page pageEncoding="UTF-8" />
<!-- PostgreSQL 版 -->
<og:equals val1="{@DBF.NAME @DBID}" val2="POSTGRES">
  <og:query command="NEW" dbid="{@DBID}" debug="{@debug}" maxRowCount="0">
  </og:query>
</og:equals>

<!-- ORACLE 版 -->
<og:equals val1="{@DBF.NAME @DBID}" val2="ORACLE">
  <!-- FUNCTION,PACKAGE,PACKAGE BODY,PROCEDURE,TYPE,TYPE BODY,TRIGGER が対象 -->
  <og:query command="NEW" dbid="{@DBID}" debug="{@debug}" maxRowCount="0">
		select TYPE			as OBJ_TYPE,
				NAME		as OBJ_NAME,
				NAME		as NAME_JA,
				LINE		as NOLINE ,
				'0' 		as FGNG ,
				TEXT		as SRC_TEXT ,
				'{@MEM.SYSTEM_ID}' AS SYSTEM_ID,
				'{@TBLSYU}' AS TBLSYU
		from USER_SOURCE
		where	INSTR(NAME,'$') < 1
	<og:where startKey="and">
		<og:and value="TYPE =		'{@OBJ_TYPE2}'"	/>
		<og:and value="NAME like	'{@OBJ_NAME}%'"	/>
	</og:where>
		union
		select TYPE			as OBJ_TYPE,
				NAME		as OBJ_NAME,
				NAME		as NAME_JA,
				LINE		as NOLINE ,
				'1'			as FGNG,
				TEXT		as SRC_TEXT ,
				'{@MEM.SYSTEM_ID}' AS SYSTEM_ID,
				'{@TBLSYU}' AS TBLSYU
		from USER_ERRORS
		where	INSTR(NAME,'$') < 1
		and		TEXT not like 'PL/SQL%ignored%'
	<og:where startKey="and">
		<og:and value="TYPE =		'{@OBJ_TYPE2}'"	/>
		<og:and value="NAME like	'{@OBJ_NAME}%'"	/>
	</og:where>
		order by 1,2,4,5
  </og:query>
</og:equals>

<!-- FIREBIRD 版 -->
<og:equals val1="{@DBF.NAME @DBID}" val2="FIREBIRD">
  <og:query command="NEW" dbid="{@DBID}" debug="{@debug}" maxRowCount="0">
	select 'TRIGGER'			as OBJ_TYPE,
			RDB$TRIGGER_NAME	as OBJ_NAME,
			RDB$TRIGGER_NAME	as NAME_JA,
			0					as NOLINE ,
			'0'					as FGNG,
			RDB$TRIGGER_SOURCE	as SRC_TEXT ,
			'{@MEM.SYSTEM_ID}' AS SYSTEM_ID,
			'{@TBLSYU}' AS TBLSYU
	from RDB$TRIGGERS
	where RDB$SYSTEM_FLAG = 0
	<og:where startKey="and">
		<og:and value="'TRIGGER'		=		'{@OBJ_TYPE2}'"	/>
		<og:and value="RDB$TRIGGER_NAME like	'{@OBJ_NAME}%'"	/>
	</og:where>
	union
	select 'PROCEDURE'				as OBJ_TYPE,
			RDB$PROCEDURE_NAME		as OBJ_NAME,
			RDB$PROCEDURE_NAME		as NAME_JA,
			0						as NOLINE ,
			'0'						as FGNG,
			RDB$PROCEDURE_SOURCE	as SRC_TEXT ,
			'{@MEM.SYSTEM_ID}' AS SYSTEM_ID,
			'{@TBLSYU}' AS TBLSYU
	from RDB$PROCEDURES
	where RDB$SYSTEM_FLAG = 0
	<og:where startKey="and">
		<og:and value="'PROCEDURE'		=		'{@OBJ_TYPE2}'"	/>
		<og:and value="RDB$PROCEDURE_NAME like	'{@OBJ_NAME}%'"	/>
	</og:where>
	union
	select 'FUNCTION'			as OBJ_TYPE,
			RDB$FUNCTION_NAME	as OBJ_NAME,
			RDB$FUNCTION_NAME	as NAME_JA,
			0						as NOLINE ,
			'0'						as FGNG,
			RDB$MODULE_NAME			as SRC_TEXT ,
			'{@MEM.SYSTEM_ID}' AS SYSTEM_ID,
			'{@TBLSYU}' AS TBLSYU
	from RDB$FUNCTIONS
	where RDB$SYSTEM_FLAG = 0
	<og:where startKey="and">
		<og:and value="'FUNCTION'		=		'{@OBJ_TYPE2}'"	/>
		<og:and value="RDB$FUNCTION_NAME like	'{@OBJ_NAME}%'"	/>
	</og:where>
		order by 1,2,4,5
  </og:query>
</og:equals>
