<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE DatabaseProfile SYSTEM "dbvis-defs.dtd">

<!--
   Created by Mimer Information Technology AB, Bengt Gunne,
   exclusively for DbVisualizer.
-->

<DatabaseProfile
        desc="Profile for Mimer SQL"
        version="$Revision: 20453 $"
        date="$Date: 2016-06-14 03:48:53 +0200 (Tis, 14 Jun 2016) $"
        minver="9.5"
        extends="generic">

   <!--
   Revision history:
     BG 2017-02-03 Use new INFORMATION_SCHEMA.EXT_MESSAGES to return error texts as this view is available to all users
     BG 2015-12-01 Use INFORMATION_SCHEMA.EXT_ONEROW rather than SYSTEM.ONEROW as it is more efficient
     BG 2015-08-29 Support for new server type Mimer SQL Auto
     RB 2014-11-27 Must get TABLE_CATALOG in the getTables command as it is needed by References viewers
     BG 2013-06-03 Added information, add/drop login authorization
     BG 2013-05-31 Added information about column cardinality from last statistics run for columns.
     BG 2013-05-31 Added support for access paths that are shown for each table.
     BG 2013-04-23 Addded support for data type when displaying and creating sequences.
     BG 2013-01-30 Added support for different types of index column algorithms such as WORD_SEARCH
     BG 2012-10-22 Added column CARDINALITY to TableFacts output which shows number of rows found by statistics.
                   Added description to table facts output.
     BG 2011-12-07 Corrected GetTableSource for version 9.2 servers.
     BG 2011-11-22 Set function type for module routines. Shows info tab and result tab correctly.
     BG 2011-05-11 INFORMATION_SCHEMA columns CONDITION_xxx are now called ACTION_xxx.
     BG 2011-05-10 Sort schema names.
     HB 2010-07-13 Added Export actions for View, Function, Procedure, Module and Trigger nodes
     RB 2010-06-01 Changed all name="table" to name="objectname" for all
                   JDBC command references
     HB 2009-10-29 Changed doclink for links to Export and Import chapter
     BG 2009-06-05 Added information about base data types as well.
     HB 2009-06-03 Added "resetschemas" for the Create and Drop Schema actions
     RB 2009-06-03 Split resultsetaction attribute into resulttype and resultaction
     BG 2009-06-02 When creating index in another schema the index name must be prefixed with schema name.
     BG 2009-05-27 Major revision with support for user defined types.
                   Parameters and return values now have type name to ease use of overloaded routines.
                   Use complete data type specification rather than data_type, precision, scale columns.
                   Added constraints and indexes under table node.
                   Added columns under index nodes.
                   Added columns under constraint nodes.
                   Added default values for various create functions that uses a grid.
     BG 2009-05-19 Added Constraints and Indexes node under Table node.
                   Added Comment On schema including display of comment.
                   Added collate-clause to SQL query for Column Uses-display.
     HB 2009-04-21 Added Import Table Data (to new table) action for Tables node.
     HB 2009-02-04 Added Export Table action for the Table node.
     BG 2008-11-04 Added create index command for table column.
                   Show indexes in column-used-by and table-used-by views.
                   Added Column uses tab for table and view columns.
                   Added drop index dialog for tables.
     HB 2008-12-30 Added "Script to Editor: CALL" actions for Function and Procedure
     HB 2008-10-27 Replaced the SQL for getViewSource with new recieved from Bengt
     HB 2008-09-30 Added fields for Specific Name in the Create Function/Procedure dialogs
     HB 2008-07-23 Modified getFunctions() and getProcedures() to only return objects that are not part
                   of a module, since these cannot be edited separately from their module (see below).
                   Modified getTriggers() so that it can be used for both all triggers and for all
                   triggers that belong to a specific table or view (see below).
                   Added Export Schema action for the Schema node.
                   Added a Triggers subnode for Table and View nodes.
                   For 9.3 or later, added the "specific name" within parenthesis to the label for
                   Function and Procedure nodes, to get unique labels (important when editing, see below).
                   Changed the Procedure and Function subnodes for Module nodes to ModuleProcedure and
                   ModuleFunction nodes. The new types have the same views etc. as the previous versions
                   of Procedure and Function nodes.
                   Added a Source Editor view for Procedure, Function, Module and Trigger nodes, and 
                   removed the old read-only DDL view for these nodes, with Personal.
     BG 2008-04-01 Use quoted identifiers for idents, databank, and shadows to allow mixed case names.
     BG 2008-03-18 Added explicit collations to sort out ambiguities in union all branches.
     BG 2007-10-17 Make domain default values better as (null) was displayed when there was no default.
                   Provide a list of data types rather than nvarchar(20) in many dialogs.
                   Make action dialogs clearer by eliminating double quotes from Labels.
                   Support for column grid for table create, add foreign key, and primary key/unique dialogs.
                   Use number style for numeric sequence fields.
                   Allow any case when searching for error message strings.
                   Updated dialogs where sizes are given in K, M, and G for better readability.
                   Use of more predefined SQL commands to ease maintenance.
     BG 2007-09-10 Corrected references view to handle table owner correctly.
     BG 2007-08-16 Added support for Replication nodes.
                   Do not show alter table submenu when Personal edition.
                   Use SQL-create table in free edition for better formatting (not a single line).
     BG 2007-08-10 Complete support for function and procedure names with overloaded parameters (same name).
     BG 2007-01-17 Added support for 9.3 of Mimer SQL.
-->

   <!-- =================================================================== -->
   <!-- Definition of the commands -->
   <!-- =================================================================== -->

   <Commands extends="true">

      <!-- =================================================================== -->
      <!-- Definition of the generic error handler (for all Commands). Its -->
      <!-- conditions will be evaluated with possible errors produced by each -->
      <!-- commands. If a match is found then the text in the <Message> -->
      <!-- element will be displayed in DbVisualizer. -->
      <!-- =================================================================== -->

      <OnError>
         <If test="#result.getErrorCode() in {-22013, -22014, -22015}" context="runtime">
            <Message>
               <![CDATA[
        Your connection with the database server has been interrupted!
        Please <a href="connect" action="connect">connect</a> to re-establish the
        connection.
               ]]>
            </Message>
         </If>
      </OnError>

      <!--
          The information returned by the queries does not include catalog
          information as this is currently not used in Mimer SQL.

          Basically all views are overriden to provide output that is easier to
          understand than what is provided by the JDBC metadata functions which
          are really intended for programs rather than being display friendly.
       -->

      <!--
        The "getTableNamesFor" command is used by Database getTableNamesFor().
        It must return table names for the catalog and schema named by
        the ${table_catalog} and ${table_catalog} variables in the first
        column.
    -->
      <Command id="mimer.getTableNamesFor">
         <SQL>
            <![CDATA[
select TABLE_NAME
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_TYPE = 'BASE TABLE'
order by TABLE_NAME
            ]]>
         </SQL>
      </Command>

      <!--
        The "getColumnNamesFor" command is used by Database getColumnNamesFor().
        It must return column names for the catalog, schema and table named by
        the ${table_catalog}, ${table_catalog} and ${table_name} variables in
        the first column.
    -->
      <Command id="mimer.getColumnNamesFor">
         <SQL>
            <![CDATA[
select COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
order by COLUMN_NAME
            ]]>
         </SQL>
      </Command>

      <!--
          The EXT_SCHEMAS view shows all schemas that the user has some kind
          of access to. The view does not return the SYSTEM schema even though it has
          accessible objects so add it in a union. If the view changes the select
          will continue to work as union is used rather than union all.
       -->
      <Command id="mimer.getSchemas">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select distinct case when OBJECT_TYPE = 'SCHEMA' then OBJECT_NAME else OBJECT_SCHEMA end as SCHEMA_NAME
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA is not null
union
select SCHEMA_NAME
from INFORMATION_SCHEMA.SCHEMATA
where SCHEMA_NAME <> SCHEMA_OWNER
union
select 'SYSTEM' from INFORMATION_SCHEMA.EXT_ONEROW
union
select CURRENT_USER from INFORMATION_SCHEMA.EXT_ONEROW
order by SCHEMA_NAME
               ]]>
            </If>
            <Else>
               <![CDATA[
select SCHEMA_NAME from INFORMATION_SCHEMA.EXT_SCHEMAS
union
select 'SYSTEM' from INFORMATION_SCHEMA.EXT_ONEROW
order by SCHEMA_NAME
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getSchemaNames">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select distinct case when OBJECT_TYPE = 'SCHEMA' then OBJECT_NAME else OBJECT_SCHEMA end as SCHEMA_NAME
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA is not null
union
select SCHEMA_NAME
from INFORMATION_SCHEMA.SCHEMATA
where SCHEMA_NAME <> SCHEMA_OWNER
union
select 'SYSTEM' from INFORMATION_SCHEMA.EXT_ONEROW
union
select CURRENT_USER from INFORMATION_SCHEMA.EXT_ONEROW
order by SCHEMA_NAME
               ]]>
            </If>
            <Else>
               <![CDATA[
select SCHEMA_NAME from INFORMATION_SCHEMA.EXT_SCHEMAS
union
select 'SYSTEM' from INFORMATION_SCHEMA.EXT_ONEROW
order by SCHEMA_NAME
               ]]>
            </Else>
         </SQL>
         <!--Must have Filter element here since this command is fetched from code-->
         <Filter index="SCHEMA_NAME" label="Name"/>
      </Command>

      <Command id="mimer.getSchemaFacts">
         <SQL>
            <![CDATA[
select OBJECT_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA IS NULL
and OBJECT_TYPE = 'SCHEMA'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSchemaComment">
         <SQL>
            <![CDATA[
select OBJECT_NAME,REMARKS
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA IS NULL
and OBJECT_TYPE = 'SCHEMA'
and OBJECT_NAME = '${schema}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSchemaInfo">
         <SQL>
            <![CDATA[
select SCHEMA_NAME,SCHEMA_OWNER from INFORMATION_SCHEMA.SCHEMATA
where SCHEMA_NAME = '${schema_name}'
            ]]>
         </SQL>
      </Command>

      <!--Need to get TABLE_CATALOG below as it is required in the References viewers-->
      <Command id="mimer.getTables">
         <SQL>
            <![CDATA[
select TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_TYPE = 'BASE TABLE'
order by TABLE_SCHEMA,TABLE_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableFacts">
         <SQL>
            <![CDATA[
select T.TABLE_SCHEMA,T.TABLE_NAME,CREATION_DATE,
case when CREATION_DATE <> ALTERATION_DATE then ALTERATION_DATE end as ALTERATION_DATE,STATISTICS_GATHERED,
            ]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[CARDINALITY,]]>
            </If>
            <![CDATA[
REMARKS
from (INFORMATION_SCHEMA.TABLES T
join INFORMATION_SCHEMA.EXT_TABLE_DATABANK_USAGE TDU
  on (T.TABLE_SCHEMA = TDU.TABLE_SCHEMA
  and T.TABLE_NAME = TDU.TABLE_NAME)
left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
  on (T.TABLE_SCHEMA = OBJECT_SCHEMA and
      T.TABLE_NAME = OBJECT_NAME and
      T.TABLE_TYPE = OBJECT_TYPE))
left outer join INFORMATION_SCHEMA.EXT_STATISTICS S
  on (T.TABLE_SCHEMA = S.TABLE_SCHEMA and
      T.TABLE_NAME = S.TABLE_NAME)
where T.TABLE_SCHEMA = '${schema}'
and T.TABLE_TYPE = 'BASE TABLE'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableInfo">
         <SQL>
            <![CDATA[
select T.TABLE_SCHEMA,T.TABLE_NAME,TDU.DATABANK_NAME
from INFORMATION_SCHEMA.TABLES T
join INFORMATION_SCHEMA.EXT_TABLE_DATABANK_USAGE TDU
  on (T.TABLE_SCHEMA = TDU.TABLE_SCHEMA
  and T.TABLE_NAME = TDU.TABLE_NAME)
where T.TABLE_SCHEMA = '${table_schema}'
and T.TABLE_NAME = '${table_name}'
and T.TABLE_TYPE = 'BASE TABLE'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableConstraints">
         <SQL>
            <![CDATA[
select TC.CONSTRAINT_SCHEMA,TC.CONSTRAINT_NAME,TC.TABLE_SCHEMA,TC.TABLE_NAME,TC.CONSTRAINT_TYPE
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
where TC.CONSTRAINT_SCHEMA = '${table_schema}' 
and TC.TABLE_SCHEMA = '${table_schema}'
and TC.TABLE_NAME = '${table_name}'
            ]]>
         </SQL>
      </Command>

      <!--<Command id="mimer.getTableConstraintsInfo">
      <SQL>
        <![CDATA[
select TC.CONSTRAINT_SCHEMA,TC.CONSTRAINT_NAME,TC.TABLE_SCHEMA,TC.TABLE_NAME,CCU.COLUMN_NAME,TC.CONSTRAINT_TYPE,
       TC.IS_DEFERRABLE,TC.INITIALLY_DEFERRED,CC.CHECK_CLAUSE
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC LEFT OUTER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CCU ON
(TC.CONSTRAINT_SCHEMA = CCU.CONSTRAINT_SCHEMA and
 TC.CONSTRAINT_NAME = CCU.CONSTRAINT_NAME)
where TC.CONSTRAINT_SCHEMA = '${table_schema}' 
and TC.TABLE_SCHEMA = '${table_schema}' and TC.TABLE_NAME = '${table_name}'
            ]]>
      </SQL>
    </Command>-->

      <Command id="mimer.getTableConstraint">
         <SQL>
            <![CDATA[
select TC.CONSTRAINT_SCHEMA,TC.CONSTRAINT_NAME,CCU.TABLE_SCHEMA,CCU.TABLE_NAME,CCU.COLUMN_NAME,TC.CONSTRAINT_TYPE,
       TC.IS_DEFERRABLE,TC.INITIALLY_DEFERRED,CC.CHECK_CLAUSE
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC LEFT OUTER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CCU on
(TC.CONSTRAINT_SCHEMA = CCU.CONSTRAINT_SCHEMA and
 TC.CONSTRAINT_NAME = CCU.CONSTRAINT_NAME)
left outer join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC ON
(TC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
 TC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where TC.CONSTRAINT_SCHEMA = '${table_schema}' and TC.TABLE_SCHEMA = '${table_schema}' 
and TC.TABLE_NAME = '${table_name}'
and TC.CONSTRAINT_NAME = '${constraint_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableConstraintWithColumn">
         <SQL>
            <![CDATA[
select TC.CONSTRAINT_SCHEMA,TC.CONSTRAINT_NAME,CCU.TABLE_SCHEMA,CCU.TABLE_NAME,CCU.COLUMN_NAME,TC.CONSTRAINT_TYPE,
       TC.IS_DEFERRABLE,TC.INITIALLY_DEFERRED
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC LEFT OUTER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CCU ON
(TC.CONSTRAINT_SCHEMA = CCU.CONSTRAINT_SCHEMA and
 TC.CONSTRAINT_NAME = CCU.CONSTRAINT_NAME)
where TC.CONSTRAINT_SCHEMA = '${table_schema}' and TC.TABLE_SCHEMA = '${table_schema}' 
and TC.TABLE_NAME = '${table_name}'
and TC.CONSTRAINT_NAME = '${constraint_name}'
and CCU.COLUMN_NAME is not null;
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getColumns">
         <SQL>
            select
            C.TABLE_SCHEMA,C.TABLE_NAME,C.COLUMN_NAME,ORDINAL_POSITION,IS_NULLABLE,
            <If test="#util.isDatabaseVersionGTE(10)">
               case when DATA_TYPE = 'USER-DEFINED' then
               case when USER_DEFINED_TYPE_SCHEMA = CURRENT_USER then '' else
               USER_DEFINED_TYPE_SCHEMA || '.' end ||
               USER_DEFINED_TYPE_NAME
               else
            </If>
            DATA_TYPE
            <If test="#util.isDatabaseVersionGTE(10)">
               collate SQL_IDENTIFIER
            </If>
            ||
            case DATA_TYPE
            when 'DOUBLE PRECISION' then ''
            when 'REAL' then ''
            when 'FLOAT' then ''
            when 'INTEGER' then ''
            when 'SMALLINT' then ''
            when 'BIGINT' then ''
            when 'DATE' then ''
            when 'INTERVAL'
            then case INTERVAL_TYPE
            when 'YEAR TO MONTH' then ' YEAR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MONTH'
            when 'DAY TO HOUR' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO HOUR'
            when 'DAY TO MINUTE' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'DAY TO SECOND' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'HOUR TO MINUTE' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'HOUR TO SECOND' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'MINUTE TO SECOND' then ' MINUTE(' || cast(INTERVAL_PRECISION
            as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'SECOND' then ' SECOND(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
            else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ')'
            end
            when 'DECIMAL' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            when 'NUMERIC' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) is NULL then ''
            else '(' ||
            cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) as varchar(20)) || ')'
            end
            end
            <If test="#util.isDatabaseVersionGTE(10)">
               end
            </If>
            as DATA_TYPE,
            COLUMN_DEFAULT,COLLATION_SCHEMA,COLLATION_NAME,DOMAIN_SCHEMA,DOMAIN_NAME
             <If test="#util.isDatabaseVersionGTE(10,1)">
            ,COLUMN_CARD
            </If>
            from INFORMATION_SCHEMA.COLUMNS C
            where C.TABLE_SCHEMA = '${table_schema}'
            and C.TABLE_NAME = '${table_name}'
            order by ORDINAL_POSITION
         </SQL>
      </Command>

      <Command id="mimer.getColumnsComment">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select T.TABLE_SCHEMA,T.TABLE_NAME,cast(null as varchar(128)) as COLUMN_NAME,OIU.REMARKS
from INFORMATION_SCHEMA.TABLES T left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE OIU
on (T.TABLE_SCHEMA = OIU.OBJECT_SCHEMA and
    T.TABLE_NAME = OIU.OBJECT_NAME and
    OIU.OBJECT_TYPE = '${object_type}')
where T.TABLE_SCHEMA  = '${table_schema}'
and T.TABLE_NAME = '${table_name}'
union
select C.TABLE_SCHEMA,C.TABLE_NAME,C.COLUMN_NAME,REMARKS
from INFORMATION_SCHEMA.COLUMNS C left outer join INFORMATION_SCHEMA.EXT_COLUMN_REMARKS CR
on (C.TABLE_SCHEMA = CR.TABLE_SCHEMA and
    C.TABLE_NAME = CR.TABLE_NAME and
    C.COLUMN_NAME = CR.COLUMN_NAME)
where C.TABLE_SCHEMA = '${table_schema}'
and C.TABLE_NAME = '${table_name}'
           ]]>
            </If>
            <Else>
               <![CDATA[
select T.TABLE_SCHEMA,T.TABLE_NAME,cast(null as varchar(128)) as COLUMN_NAME,OIU.REMARKS
from INFORMATION_SCHEMA.TABLES T left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE OIU
on (T.TABLE_SCHEMA = OIU.OBJECT_SCHEMA and
    T.TABLE_NAME = OIU.OBJECT_NAME and
    OIU.OBJECT_TYPE = '${object_type}')
where T.TABLE_SCHEMA  = '${table_schema}'
and T.TABLE_NAME = '${table_name}'
union all
select C.TABLE_SCHEMA,C.TABLE_NAME,C.COLUMN_NAME,coalesce(REMARKS,'')
from INFORMATION_SCHEMA.COLUMNS C left outer join INFORMATION_SCHEMA.EXT_COLUMN_REMARKS CR
on (C.TABLE_SCHEMA = CR.TABLE_SCHEMA and
    C.TABLE_NAME = CR.TABLE_NAME and
    C.COLUMN_NAME = CR.COLUMN_NAME)
where C.TABLE_SCHEMA = '${table_schema}'
and C.TABLE_NAME = '${table_name}'
           ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getTableSource">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select 'create table "' ||
case when TABLE_SCHEMA = CURRENT_USER then '' else TABLE_SCHEMA || '"."' end ||
TABLE_NAME || '"(' || ascii_char(10), '' as CONSTRAINT_NAME, -1 as LINE_NUMBER
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
union all
select case when ORDINAL_POSITION = 1 then '     "' else '   , "' end  || COLUMN_NAME || '" ' ||
case when DOMAIN_NAME is not null then ' "' || DOMAIN_SCHEMA || '"."' || DOMAIN_NAME || '"'
else DATA_TYPE ||
     case DATA_TYPE
     when 'DOUBLE PRECISION' then ''
     when 'REAL' then ''
     when 'FLOAT' then ''
     when 'INTEGER' then ''
     when 'SMALLINT' then ''
     when 'BIGINT' then ''
     when 'DATE' then ''
     when 'INTERVAL'
     then case INTERVAL_TYPE
          when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
          when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
          when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
          end
     when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
          else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
          end
     end
end ||
case when COLUMN_DEFAULT is not null then ' default ' || COLUMN_DEFAULT
     else ''
     end || ascii_char(10), '' as CONSTRAINT_NAME, ORDINAL_POSITION as LINE_NUMBER
from information_schema.columns
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
union all
select trim(trailing from
        case when CU.ORDINAL_POSITION = 1
        then '   , constraint "' || TC.CONSTRAINT_NAME || '" ' || lower(TC.CONSTRAINT_TYPE) || '("' || CU.COLUMN_NAME || '"'
        else ', "' || CU.COLUMN_NAME || '"'
        end) ||
       trim(trailing from
        case when CU2.ORDINAL_POSITION is null
            then ')' || case when TC.CONSTRAINT_TYPE = 'FOREIGN KEY'
                             then ' references "' || TC2.TABLE_SCHEMA || '"."' || TC2.TABLE_NAME || '"'
                             else '' end || ASCII_CHAR(10)
            else '' end)
, TC.CONSTRAINT_NAME, CU.ORDINAL_POSITION
from (INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU left outer join INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU2
on (CU.CONSTRAINT_SCHEMA = CU2.CONSTRAINT_SCHEMA and
    CU.CONSTRAINT_NAME = CU2.CONSTRAINT_NAME and
    CU.ORDINAL_POSITION+1 = CU2.ORDINAL_POSITION) join INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
on (TC.CONSTRAINT_SCHEMA = CU.CONSTRAINT_SCHEMA and
    TC.CONSTRAINT_NAME = CU.CONSTRAINT_NAME))
left outer join (INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC join INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC2
                                   on (RC.UNIQUE_CONSTRAINT_SCHEMA = TC2.CONSTRAINT_SCHEMA
                                   and RC.UNIQUE_CONSTRAINT_NAME = TC2.CONSTRAINT_NAME))
on (RC.CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
  and RC.CONSTRAINT_NAME = TC.CONSTRAINT_NAME)
where TC.CONSTRAINT_TYPE in ('UNIQUE','PRIMARY KEY','FOREIGN KEY')
and TC.TABLE_SCHEMA = '${table_schema}'
and TC.TABLE_NAME = '${table_name}'
union all
select '   , constraint "' || CC.CONSTRAINT_NAME || '" check(' || CC.CHECK_CLAUSE || ')' || ascii_char(10), CC.CONSTRAINT_NAME, 1
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.TABLE_SCHEMA = '${table_schema}'
and DC.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is not null
union all
select case when SD.LINE_NUMBER = 1
            then '   , constraint "' || CC.CONSTRAINT_NAME ||
                 '"' || ascii_char(10) ||'          check('
            else ''
            end ||
       SD.SOURCE_DEFINITION ||
       case when SD.LINE_NUMBER = (select max(LINE_NUMBER) from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD2
                                   where SD2.OBJECT_SCHEMA = SD.OBJECT_SCHEMA
                                   and SD2.OBJECT_NAME = SD.OBJECT_NAME)
            then ')' || ascii_char(10)
            else ''
            end, CC.CONSTRAINT_NAME, LINE_NUMBER
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC3
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (TC3.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    TC3.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
join INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD
on (CC.CONSTRAINT_SCHEMA = SD.OBJECT_SCHEMA and
    CC.CONSTRAINT_NAME = SD.OBJECT_NAME)
where TC3.TABLE_SCHEMA = '${table_schema}'
and TC3.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is null
union all
select ')', ascii_char(255), 10000
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
order by CONSTRAINT_NAME,LINE_NUMBER
            ]]>
            </If>
            <Else>
               <![CDATA[
select 'create table "' ||
case when TABLE_SCHEMA = CURRENT_USER then '' else TABLE_SCHEMA || '"."' end ||
TABLE_NAME || '"(' || ascii_char(10), '' as CONSTRAINT_NAME, -1 as LINE_NUMBER
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
union all
select case when ORDINAL_POSITION = 1 then '     "' else '   , "' end  || COLUMN_NAME || '" ' ||
case when DOMAIN_NAME is not null then ' "' || DOMAIN_SCHEMA || '"."' || DOMAIN_NAME || '"'
          ]]>
               <If test="#util.isDatabaseVersionGTE(10)">
                  <![CDATA[ collate SQL_IDENTIFIER 
else 
case when DATA_TYPE = 'USER-DEFINED' then
     case when USER_DEFINED_TYPE_SCHEMA = CURRENT_USER then '' else USER_DEFINED_TYPE_SCHEMA || '.' end ||
     USER_DEFINED_TYPE_NAME
          ]]>
               </If>
               <![CDATA[
else DATA_TYPE]]>
               <If test="#util.isDatabaseVersionGTE(10)">
                  <![CDATA[ collate SQL_IDENTIFIER ]]>
               </If>
               <![CDATA[ ||
     case DATA_TYPE
     when 'DOUBLE PRECISION' then ''
     when 'REAL' then ''
     when 'FLOAT' then ''
     when 'INTEGER' then ''
     when 'SMALLINT' then ''
     when 'BIGINT' then ''
     when 'DATE' then ''
     when 'INTERVAL'
     then case INTERVAL_TYPE
          when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
          when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
          when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
          end
     when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
          else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
          end
     end
]]>
               <If test="#util.isDatabaseVersionGTE(10)">
                  <![CDATA[ end ]]>
               </If>
               <![CDATA[
end ||
case when COLLATION_NAME is not null and (
          (COLLATION_SCHEMA <> 'INFORMATION_SCHEMA' or
           (COLLATION_NAME <> 'ISO8BIT' and COLLATION_NAME <> 'UCS_BASIC'))) then ' collate "' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"'
     else ''
     end ||
case when COLUMN_DEFAULT is not null then ' default ' || COLUMN_DEFAULT
     else ''
     end || ascii_char(10), '' as CONSTRAINT_NAME, ORDINAL_POSITION as LINE_NUMBER
from information_schema.columns
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
union all
select trim(trailing from
        case when ORDINAL_POSITION = 1
        then '   , constraint "' || TC.CONSTRAINT_NAME || '" ' || lower(CONSTRAINT_TYPE) || '("' || COLUMN_NAME || '"'
        else ', "' || COLUMN_NAME || '"'
        end) ||
       trim(trailing from
        case when ORDINAL_POSITION =
                 (select max(ORDINAL_POSITION) from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
                  where TABLE_SCHEMA = '${table_schema}'
                  and TABLE_NAME = '${table_name}'
                  and CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
                  and CONSTRAINT_NAME = TC.CONSTRAINT_NAME)
            then ')' || case when TC.CONSTRAINT_TYPE = 'FOREIGN KEY'
                             then ' references "' ||
                                  (select TC2.TABLE_SCHEMA || '"."' || TC2.TABLE_NAME || '"'
                                   from INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC join INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC2
                                   on (RC.UNIQUE_CONSTRAINT_SCHEMA = TC2.CONSTRAINT_SCHEMA
                                   and RC.UNIQUE_CONSTRAINT_NAME = TC2.CONSTRAINT_NAME)
                                   where RC.CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
                                   and RC.CONSTRAINT_NAME = TC.CONSTRAINT_NAME)
                             else '' end || ASCII_CHAR(10)
            else '' end)
, TC.CONSTRAINT_NAME, CU.ORDINAL_POSITION
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC join INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU
on (TC.CONSTRAINT_SCHEMA = CU.CONSTRAINT_SCHEMA and
    TC.CONSTRAINT_NAME = CU.CONSTRAINT_NAME)
where TC.CONSTRAINT_TYPE in ('UNIQUE','PRIMARY KEY','FOREIGN KEY')
and TC.TABLE_SCHEMA = '${table_schema}'
and TC.TABLE_NAME = '${table_name}'
union all
select '   , constraint "' || CC.CONSTRAINT_NAME || '" check(' || CC.CHECK_CLAUSE || ')' || ascii_char(10), CC.CONSTRAINT_NAME, 1
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.TABLE_SCHEMA = '${table_schema}'
and DC.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is not null
union all
select case when SD.LINE_NUMBER = 1
            then '   , constraint "' || CC.CONSTRAINT_NAME ||
                 '"' || ascii_char(10) ||'          check('
            else ''
            end ||
       SD.SOURCE_DEFINITION ||
       case when SD.LINE_NUMBER = (select max(LINE_NUMBER) from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD2
                                   where SD2.OBJECT_SCHEMA = SD.OBJECT_SCHEMA
                                   and SD2.OBJECT_NAME = SD.OBJECT_NAME)
            then ')' || ascii_char(10)
            else ''
            end, CC.CONSTRAINT_NAME, LINE_NUMBER
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC3
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (TC3.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    TC3.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
join INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD
on (CC.CONSTRAINT_SCHEMA = SD.OBJECT_SCHEMA and
    CC.CONSTRAINT_NAME = SD.OBJECT_NAME)
where TC3.TABLE_SCHEMA = '${table_schema}'
and TC3.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is null
union all
select ')', ascii_char(255), 10000
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
order by CONSTRAINT_NAME,LINE_NUMBER
]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getConstraintSource">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select 'alter table "' ||
case when TABLE_SCHEMA = CURRENT_USER then '' else TABLE_SCHEMA || '"."' end ||
TABLE_NAME || '" add ' || ascii_char(10), '' as CONSTRAINT_NAME, -1 as LINE_NUMBER
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
union all
select trim(trailing from
        case when CU.ORDINAL_POSITION = 1
        then '   constraint "' || TC.CONSTRAINT_NAME || '" ' || lower(TC.CONSTRAINT_TYPE) || '("' || CU.COLUMN_NAME || '"'
        else ', "' || CU.COLUMN_NAME || '"'
        end) ||
       trim(trailing from
        case when CU2.ORDINAL_POSITION is null
            then ')' || case when TC.CONSTRAINT_TYPE = 'FOREIGN KEY'
                             then ' references "' || TC2.TABLE_SCHEMA || '"."' || TC2.TABLE_NAME || '"'
                             else '' end || ASCII_CHAR(10)
            else '' end)
, TC.CONSTRAINT_NAME, CU.ORDINAL_POSITION
from (INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU left outer join INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU2
on (CU.CONSTRAINT_SCHEMA = CU2.CONSTRAINT_SCHEMA and
    CU.CONSTRAINT_NAME = CU2.CONSTRAINT_NAME and
    CU.ORDINAL_POSITION+1 = CU2.ORDINAL_POSITION) join INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
on (TC.CONSTRAINT_SCHEMA = CU.CONSTRAINT_SCHEMA and
    TC.CONSTRAINT_NAME = CU.CONSTRAINT_NAME))
left outer join (INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC join INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC2
                                   on (RC.UNIQUE_CONSTRAINT_SCHEMA = TC2.CONSTRAINT_SCHEMA
                                   and RC.UNIQUE_CONSTRAINT_NAME = TC2.CONSTRAINT_NAME))
on (RC.CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
  and RC.CONSTRAINT_NAME = TC.CONSTRAINT_NAME)
where TC.CONSTRAINT_TYPE in ('UNIQUE','PRIMARY KEY','FOREIGN KEY')
and TC.TABLE_SCHEMA = '${table_schema}'
and TC.TABLE_NAME = '${table_name}'
and TC.CONSTRAINT_NAME = '${constraint_name}'
union all
select '   constraint "' || CC.CONSTRAINT_NAME || '" check(' || CC.CHECK_CLAUSE || ')' || ascii_char(10), CC.CONSTRAINT_NAME, 1
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.TABLE_SCHEMA = '${table_schema}'
and DC.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is not null
and DC.CONSTRAINT_NAME = '${constraint_name}'
and CC.CONSTRAINT_NAME = '${constraint_name}'
union all
select case when SD.LINE_NUMBER = 1
            then '   constraint "' || CC.CONSTRAINT_NAME ||
                 '"' || ascii_char(10) ||'          check('
            else ''
            end ||
       SD.SOURCE_DEFINITION ||
       case when SD.LINE_NUMBER = (select max(LINE_NUMBER) from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD2
                                   where SD2.OBJECT_SCHEMA = SD.OBJECT_SCHEMA
                                   and SD2.OBJECT_NAME = SD.OBJECT_NAME)
            then ')' || ascii_char(10)
            else ''
            end, CC.CONSTRAINT_NAME, LINE_NUMBER
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC3
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (TC3.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    TC3.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
join INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD
on (CC.CONSTRAINT_SCHEMA = SD.OBJECT_SCHEMA and
    CC.CONSTRAINT_NAME = SD.OBJECT_NAME)
where TC3.TABLE_SCHEMA = '${table_schema}'
and TC3.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is null
and CC.CONSTRAINT_NAME = '${constraint_name}'
union all
select ')', ascii_char(255), 10000
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
order by CONSTRAINT_NAME,LINE_NUMBER
            ]]>
            </If>
            <Else>
               <![CDATA[
select 'alter table "' ||
case when TABLE_SCHEMA = CURRENT_USER then '' else TABLE_SCHEMA || '"."' end ||
TABLE_NAME || '" add ' || ascii_char(10), '' as CONSTRAINT_NAME, -1 as LINE_NUMBER
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
union all
select trim(trailing from
        case when ORDINAL_POSITION = 1
        then '   constraint "' || TC.CONSTRAINT_NAME || '" ' || lower(CONSTRAINT_TYPE) || '("' || COLUMN_NAME || '"'
        else ', "' || COLUMN_NAME || '"'
        end) ||
       trim(trailing from
        case when ORDINAL_POSITION =
                 (select max(ORDINAL_POSITION) from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
                  where TABLE_SCHEMA = '${table_schema}'
                  and TABLE_NAME = '${table_name}'
                  and CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
                  and CONSTRAINT_NAME = TC.CONSTRAINT_NAME)
            then ')' || case when TC.CONSTRAINT_TYPE = 'FOREIGN KEY'
                             then ' references "' ||
                                  (select TC2.TABLE_SCHEMA || '"."' || TC2.TABLE_NAME || '"'
                                   from INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC join INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC2
                                   on (RC.UNIQUE_CONSTRAINT_SCHEMA = TC2.CONSTRAINT_SCHEMA
                                   and RC.UNIQUE_CONSTRAINT_NAME = TC2.CONSTRAINT_NAME)
                                   where RC.CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
                                   and RC.CONSTRAINT_NAME = TC.CONSTRAINT_NAME)
                             else '' end || ASCII_CHAR(10)
            else '' end)
, TC.CONSTRAINT_NAME, CU.ORDINAL_POSITION
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC join INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU
on (TC.CONSTRAINT_SCHEMA = CU.CONSTRAINT_SCHEMA and
    TC.CONSTRAINT_NAME = CU.CONSTRAINT_NAME)
where TC.CONSTRAINT_TYPE in ('UNIQUE','PRIMARY KEY','FOREIGN KEY')
and TC.TABLE_SCHEMA = '${table_schema}'
and TC.TABLE_NAME = '${table_name}'
and TC.CONSTRAINT_NAME = '${constraint_name}'
union all
select '   constraint "' || CC.CONSTRAINT_NAME || '" check(' || CC.CHECK_CLAUSE || ')' || ascii_char(10), CC.CONSTRAINT_NAME, 1
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.TABLE_SCHEMA = '${table_schema}'
and DC.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is not null
and CC.CONSTRAINT_NAME = '${constraint_name}'
union all
select case when SD.LINE_NUMBER = 1
            then '   constraint "' || CC.CONSTRAINT_NAME ||
                 '"' || ascii_char(10) ||'          check('
            else ''
            end ||
       SD.SOURCE_DEFINITION ||
       case when SD.LINE_NUMBER = (select max(LINE_NUMBER) from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD2
                                   where SD2.OBJECT_SCHEMA = SD.OBJECT_SCHEMA
                                   and SD2.OBJECT_NAME = SD.OBJECT_NAME)
            then ')' || ascii_char(10)
            else ''
            end, CC.CONSTRAINT_NAME, LINE_NUMBER
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC3
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (TC3.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    TC3.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
join INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD
on (CC.CONSTRAINT_SCHEMA = SD.OBJECT_SCHEMA and
    CC.CONSTRAINT_NAME = SD.OBJECT_NAME)
where TC3.TABLE_SCHEMA = '${table_schema}'
and TC3.TABLE_NAME = '${table_name}'
and CC.CHECK_CLAUSE is null
and CC.CONSTRAINT_NAME = '${constraint_name}'
union all
select ')', ascii_char(255), 10000
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and TABLE_TYPE = 'BASE TABLE'
order by CONSTRAINT_NAME,LINE_NUMBER
]]>
            </Else>
         </SQL>
      </Command>

    <Command id="mimer.getTableAccessPathNames">
      <SQL>
          <![CDATA[
select distinct INDEX_NAME as ACCESS_PATH_NAME,INDEX_TYPE as ACCESS_PATH_TYPE
from   INFORMATION_SCHEMA.EXT_ACCESS_PATHS 
where INDEX_SCHEMA = '${schema}'
and   TABLE_NAME = '${theTableName}'
order by ACCESS_PATH_NAME
               ]]>
      </SQL>
    </Command>

    <Command id="mimer.getTableAccessPathInfo">
      <SQL>
          <![CDATA[
select INDEX_SCHEMA as ACCESS_PATH_SCHEMA,INDEX_NAME as ACCESS_PATH_NAME,INDEX_TYPE as ACCESS_PATH_TYPE,TABLE_NAME,INDEX_ALGORITHM
from   INFORMATION_SCHEMA.EXT_ACCESS_PATHS 
where INDEX_SCHEMA = '${schema}'
and   INDEX_NAME = '${access_path_name}'
and   TABLE_NAME = '${theTableName}'
fetch 1
               ]]>
      </SQL>
    </Command>

    <Command id="mimer.getTableAccessPathColumns">
      <SQL>
          <![CDATA[
select COLUMN_NAME,ORDINAL_POSITION,COLUMN_SOURCE,COLLATION_SCHEMA,COLLATION_NAME
from   INFORMATION_SCHEMA.EXT_ACCESS_PATHS 
where INDEX_SCHEMA = '${schema}'
and   INDEX_NAME = '${access_path_name}'
and   TABLE_NAME = '${theTableName}'
order by ORDINAL_POSITION
               ]]>
      </SQL>
    </Command>

    <Command id="mimer.getTableAccessPathColumnInfo">
      <SQL>
          <![CDATA[
select INDEX_SCHEMA as ACCESS_PATH_SCHEMA,INDEX_NAME as ACCESS_PATH_NAME,INDEX_TYPE as ACCESS_PATH_TYPE,TABLE_NAME,COLUMN_NAME,ORDINAL_POSITION,COLUMN_SOURCE,COLLATION_SCHEMA,COLLATION_NAME,INDEX_ALGORITHM
from   INFORMATION_SCHEMA.EXT_ACCESS_PATHS 
where INDEX_SCHEMA = '${schema}'
and   INDEX_NAME = '${access_path_name}'
and   TABLE_NAME = '${theTableName}'
and   COLUMN_NAME = '${objectname}'
               ]]>
      </SQL>
    </Command>

      <Command id="mimer.getViews">
         <SQL>
            <![CDATA[
select TABLE_SCHEMA,TABLE_NAME,CHECK_OPTION,IS_UPDATABLE
from INFORMATION_SCHEMA.VIEWS
where TABLE_SCHEMA = '${view_schema}'
order by TABLE_SCHEMA,TABLE_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getViewFacts">
         <SQL>
            <![CDATA[
select T.TABLE_SCHEMA,T.TABLE_NAME,CREATION_DATE,
case when CREATION_DATE <> ALTERATION_DATE then ALTERATION_DATE end as ALTERATION_DATE,
REMARKS
from (INFORMATION_SCHEMA.TABLES T
left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
  on (T.TABLE_SCHEMA = OBJECT_SCHEMA and
      T.TABLE_NAME = OBJECT_NAME and
      T.TABLE_TYPE = OBJECT_TYPE))
where T.TABLE_SCHEMA = '${schema}'
and T.TABLE_TYPE = 'VIEW'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getViewInfo">
         <SQL>
            <![CDATA[
select TABLE_SCHEMA,TABLE_NAME,CHECK_OPTION,IS_UPDATABLE
from INFORMATION_SCHEMA.VIEWS
where TABLE_SCHEMA = '${view_schema}'
and TABLE_NAME = '${view_name}'
            ]]>
         </SQL>
      </Command>

      <!--
    View definition is either in INFORMATION_SCHEMA.VIEWS or in
        EXT_SOURCE_DEFINITION - never in both before version 9.3.

        The exists clauses makes sure we only get complete view definitions. We
        are only allowed to see both columns and source if we own the view either
        directly or through a schema that we own.
     -->
      <Command id="mimer.getViewSource">
         <SQL>
            <If test="#util.isDatabaseVersionLT(9)">
               <![CDATA[
select 'create view "' ||
case when '${view_schema}' = CURRENT_USER then cast('' as varchar(1)) else '${view_schema}"."' end ||
'${view_name}"(', -300 as LINE_NUMBER
from INFORMATION_SCHEMA.EXT_ONEROW
where exists (select * from INFORMATION_SCHEMA.SCHEMATA
            where SCHEMA_NAME = '${view_schema}' and SCHEMA_OWNER = CURRENT_USER)
union all
select trim(trailing from case when ORDINAL_POSITION = 1 then ascii_char(10) || '     "' else '   , "' end) || COLUMN_NAME || '"' || ascii_char(10), -300+ORDINAL_POSITION
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${view_schema}' and TABLE_NAME = '${view_name}'
and exists (select * from INFORMATION_SCHEMA.SCHEMATA
            where SCHEMA_NAME = '${view_schema}' and SCHEMA_OWNER = CURRENT_USER)
union all
select ') as ', 0
from INFORMATION_SCHEMA.EXT_ONEROW
where exists (select * from INFORMATION_SCHEMA.SCHEMATA
            where SCHEMA_NAME = '${view_schema}' and SCHEMA_OWNER = CURRENT_USER)
union all
select VIEW_DEFINITION, 1
from INFORMATION_SCHEMA.VIEWS
where TABLE_SCHEMA = '${view_schema}' and TABLE_NAME = '${view_name}'
and VIEW_DEFINITION is not null
union all
select SOURCE_DEFINITION, LINE_NUMBER
from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION
where OBJECT_SCHEMA = '${view_schema}' and OBJECT_NAME = '${view_name}'
and OBJECT_TYPE = 'VIEW'
order by LINE_NUMBER
             ]]>
            </If>
            <Else>
               <![CDATA[
select 'create view "' ||
case when '${view_schema}' = CURRENT_USER then cast('' as varchar(1)) else '${view_schema}"."' end ||
'${view_name}"('
       ]]>
               <If test="#util.isDatabaseVersionGTE(10)">
                  <![CDATA[ collate SQL_IDENTIFIER ]]>
               </If>
               <![CDATA[
, -300 as LINE_NUMBER
from INFORMATION_SCHEMA.EXT_ONEROW
where exists (select * from INFORMATION_SCHEMA.SCHEMATA
           where SCHEMA_NAME = '${view_schema}' and SCHEMA_OWNER = CURRENT_USER)
union all
select trim(trailing from case when ORDINAL_POSITION = 1 then ascii_char(10) || '     "' else '   , "' end) || COLUMN_NAME || '"' || ascii_char(10), -300+ORDINAL_POSITION
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${view_schema}' and TABLE_NAME = '${view_name}'
and exists (select * from INFORMATION_SCHEMA.SCHEMATA
           where SCHEMA_NAME = '${view_schema}' and SCHEMA_OWNER = CURRENT_USER)
union all
select ') as ', 0
from INFORMATION_SCHEMA.EXT_ONEROW
where exists (select * from INFORMATION_SCHEMA.SCHEMATA
           where SCHEMA_NAME = '${view_schema}' and SCHEMA_OWNER = CURRENT_USER)
            ]]>
               <If test="#util.isDatabaseVersionLTE(9,2)">
                  <!-- Version 9.1 or earlier. NOTE: Comment does not match version condition -->
                  <![CDATA[
union all
select VIEW_DEFINITION, 1
from INFORMATION_SCHEMA.VIEWS
where TABLE_SCHEMA = '${view_schema}' and TABLE_NAME = '${view_name}'
and VIEW_DEFINITION is not null
            ]]>
               </If>
               <![CDATA[
union all
select SOURCE_DEFINITION, LINE_NUMBER
from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION
where OBJECT_SCHEMA = '${view_schema}' and OBJECT_NAME = '${view_name}'
and OBJECT_TYPE = 'VIEW'
order by LINE_NUMBER
]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getSynonyms">
         <SQL>
            <![CDATA[
select SYNONYM_SCHEMA,SYNONYM_NAME,TABLE_SCHEMA,TABLE_NAME
from INFORMATION_SCHEMA.EXT_SYNONYMS
where SYNONYM_SCHEMA = '${synonym_schema}'
order by SYNONYM_SCHEMA,SYNONYM_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSynonymFacts">
         <SQL>
            <![CDATA[
select SYNONYM_SCHEMA,SYNONYM_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_SYNONYMS left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (SYNONYM_SCHEMA = OBJECT_SCHEMA and
    SYNONYM_NAME = OBJECT_NAME and
    'SYNONYM' = OBJECT_TYPE)
where SYNONYM_SCHEMA = '${schema}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSynonymInfo">
         <SQL>
            <![CDATA[
select SYNONYM_SCHEMA,SYNONYM_NAME,TABLE_SCHEMA,TABLE_NAME
from INFORMATION_SCHEMA.EXT_SYNONYMS
where SYNONYM_SCHEMA = '${synonym_schema}'
and SYNONYM_NAME = '${synonym_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSynonymSource">
         <SQL>
            <![CDATA[
select 'create synonym "' ||
case when SYNONYM_SCHEMA = CURRENT_USER then '' else SYNONYM_SCHEMA || '"."' end ||
'${synonym_name}" for "' || TABLE_SCHEMA || '"."' || TABLE_NAME || '"'
from INFORMATION_SCHEMA.EXT_SYNONYMS
where SYNONYM_SCHEMA = '${synonym_schema}'
and SYNONYM_NAME = '${synonym_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIndexes">
         <SQL>
            <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,TABLE_NAME,IS_UNIQUE
from INFORMATION_SCHEMA.EXT_INDEXES
where INDEX_SCHEMA = '${index_schema}'
and TABLE_NAME LIKE '${tableNamePattern}'
order by INDEX_SCHEMA, INDEX_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIndexFacts">
         <SQL>
            <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_INDEXES  left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (INDEX_SCHEMA = OBJECT_SCHEMA and
    INDEX_NAME = OBJECT_NAME and
    'INDEX' = OBJECT_TYPE)
where INDEX_SCHEMA = '${schema}'
and TABLE_NAME LIKE '${tableNamePattern}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIndexInfo">
         <SQL>
            <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,TABLE_NAME,IS_UNIQUE
from INFORMATION_SCHEMA.EXT_INDEXES
where INDEX_SCHEMA = '${index_schema}'
and INDEX_NAME = '${index_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIndexColumns">
         <SQL>
            <If test="#util.isDatabaseVersionLT(9)">
               <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,IS_UNIQUE,TABLE_NAME,COLUMN_NAME,IS_ASCENDING,ORDINAL_POSITION
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${index_schema}'
and INDEX_NAME = '${index_name}'
order by INDEX_NAME, ORDINAL_POSITION
               ]]>
            </If>
            <Else>
               <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,IS_UNIQUE,TABLE_NAME,COLUMN_NAME,IS_ASCENDING,ORDINAL_POSITION,
COLLATION_SCHEMA,COLLATION_NAME]]>
               <If test="#util.isDatabaseVersionGTE(10,1)">
                  <![CDATA[,INDEX_ALGORITHM]]>
               </If>
               <![CDATA[
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${index_schema}'
and INDEX_NAME = '${index_name}'
order by INDEX_NAME, ORDINAL_POSITION
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getIndexColumnsByTable">
         <SQL>
            <If test="#util.isDatabaseVersionLT(9)">
               <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,IS_UNIQUE,TABLE_NAME,COLUMN_NAME,IS_ASCENDING,ORDINAL_POSITION
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
order by INDEX_NAME, ORDINAL_POSITION
               ]]>
            </If>
            <Else>
               <![CDATA[
select INDEX_SCHEMA,INDEX_NAME,IS_UNIQUE,TABLE_NAME,COLUMN_NAME,IS_ASCENDING,ORDINAL_POSITION,
COLLATION_SCHEMA,COLLATION_NAME
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
order by INDEX_NAME, ORDINAL_POSITION
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getIndexSource">
         <SQL>
            <If test="#util.isDatabaseVersionLT(9)">
               <![CDATA[
select 'create' || trim(trailing from case when IS_UNIQUE = 'YES' then ' unique' else '' end) ||
' index "' ||
case when INDEX_SCHEMA = CURRENT_USER then '' else INDEX_SCHEMA || '"."' end ||
'${index_name}" on "' ||
case when INDEX_SCHEMA = CURRENT_USER then '' else INDEX_SCHEMA || '"."' end ||
TABLE_NAME || '"( ' || ascii_char(10), 0 as LINE_NUMBER
from INFORMATION_SCHEMA.EXT_INDEXES
where INDEX_SCHEMA = '${index_schema}' and INDEX_NAME = '${index_name}'
union all
select trim(trailing from case when ORDINAL_POSITION = 1 then '     "' else '   , "' end) || COLUMN_NAME || '"' ||
trim(trailing from case when IS_ASCENDING = 'YES' then ' ASC' else ' DESC' end) || ascii_char(10),ORDINAL_POSITION
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${index_schema}' and INDEX_NAME = '${index_name}'
union all
select ')',10000 from INFORMATION_SCHEMA.EXT_ONEROW
order by LINE_NUMBER
               ]]>
            </If>
            <Else>
               <![CDATA[
select 'create' || trim(trailing from case when IS_UNIQUE = 'YES' then ' unique' else '' end) ||
' index "' ||
case when INDEX_SCHEMA = CURRENT_USER then '' else INDEX_SCHEMA || '"."' end ||
'${index_name}" on "' ||
case when INDEX_SCHEMA = CURRENT_USER then '' else INDEX_SCHEMA || '"."' end ||
TABLE_NAME || '"( ' || ascii_char(10), 0 as LINE_NUMBER
from INFORMATION_SCHEMA.EXT_INDEXES
where INDEX_SCHEMA = '${index_schema}' and INDEX_NAME = '${index_name}'
union all
select trim(trailing from case when ORDINAL_POSITION = 1 then '     "' else '   , "' end) || COLUMN_NAME || '"' ||
case when COLLATION_NAME is not null and (
          (COLLATION_SCHEMA <> 'INFORMATION_SCHEMA' or
           (COLLATION_NAME <> 'ISO8BIT' and COLLATION_NAME <> 'UCS_BASIC'))) then ' collate "' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"'
     else '' end ||
               ]]>
               <If test="#util.isDatabaseVersionGTE(10,1)">
                  <![CDATA[
case when INDEX_ALGORITHM = 'SIMPLE' then '' else ' for ' || INDEX_ALGORITHM end ||
               ]]>
               </If>
               <![CDATA[
trim(trailing from case when IS_ASCENDING = 'YES' then ' ASC' else ' DESC' end) || ascii_char(10),ORDINAL_POSITION
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${index_schema}' and INDEX_NAME = '${index_name}'
union all
select ')',10000 from INFORMATION_SCHEMA.EXT_ONEROW
order by LINE_NUMBER
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getSequences">
         <SQL>
            <![CDATA[
select SEQUENCE_SCHEMA,SEQUENCE_NAME,IS_UNIQUE]]>
        <If test="#util.isDatabaseVersionGTE(10,1)">
<![CDATA[,DATA_TYPE]]>
        </If>
<![CDATA[
from INFORMATION_SCHEMA.EXT_SEQUENCES
where SEQUENCE_SCHEMA = '${sequence_schema}'
order by SEQUENCE_SCHEMA,SEQUENCE_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSequenceFacts">
         <SQL>
            <![CDATA[
select SEQUENCE_SCHEMA,SEQUENCE_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_SEQUENCES left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (SEQUENCE_SCHEMA = OBJECT_SCHEMA and
    SEQUENCE_NAME = OBJECT_NAME and
    'SEQUENCE' = OBJECT_TYPE)
where SEQUENCE_SCHEMA = '${schema}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSequenceInfo">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <![CDATA[
select SEQUENCE_SCHEMA,SEQUENCE_NAME,IS_UNIQUE,INITIAL_VALUE,INCREMENT,MAXIMUM_VALUE
from INFORMATION_SCHEMA.EXT_SEQUENCES
where SEQUENCE_SCHEMA = '${sequence_schema}'
and SEQUENCE_NAME = '${sequence_name}'
            ]]>
            </If>
            <Else>
               <![CDATA[
select SEQUENCE_SCHEMA,SEQUENCE_NAME,IS_UNIQUE,]]>
        <If test="#util.isDatabaseVersionGTE(10,1)">
<![CDATA[DATA_TYPE,]]>
        </If>
<![CDATA[INITIAL_VALUE,INCREMENT,MAXIMUM_VALUE,DATABANK_NAME
from INFORMATION_SCHEMA.EXT_SEQUENCES
where SEQUENCE_SCHEMA = '${sequence_schema}'
and SEQUENCE_NAME = '${sequence_name}'
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getSequenceSource">
         <SQL>
        <If test="#util.isDatabaseVersionLTE(10,0)">
            <![CDATA[
select 'create' ||
trim(trailing from case when IS_UNIQUE = 'YES' then ' unique' else '' end) ||
' sequence "' ||
case when SEQUENCE_SCHEMA = CURRENT_USER then '' else SEQUENCE_SCHEMA || '"."' end ||
SEQUENCE_NAME || '"' || ascii_char(10) ||
'     initial_value = ' || cast(INITIAL_VALUE as varchar(20)) || ascii_char(10) ||
'     increment = ' || cast(INCREMENT as varchar(20)) || ascii_char(10) ||
'     max_value = ' || cast(MAXIMUM_VALUE as varchar(20))
from INFORMATION_SCHEMA.EXT_SEQUENCES
where SEQUENCE_SCHEMA = '${sequence_schema}'
and SEQUENCE_NAME = '${sequence_name}'
            ]]>
        </If>
        <Else>
        <![CDATA[
select 'create' ||
trim(trailing from case when IS_UNIQUE = 'YES' then ' unique' else '' end) ||
' sequence "' ||
case when SEQUENCE_SCHEMA = CURRENT_USER then '' else SEQUENCE_SCHEMA || '"."' end ||
SEQUENCE_NAME || '"' ||]]>
        <If test="#util.isDatabaseVersionGTE(10,1)">
<![CDATA[ ' as ' || DATA_TYPE ||]]>
        </If>
<![CDATA[ ascii_char(10) ||
'     initial_value = ' || cast(INITIAL_VALUE as varchar(20)) || ascii_char(10) ||
'     increment = ' || cast(INCREMENT as varchar(20)) || ascii_char(10) ||
'     max_value = ' || cast(MAXIMUM_VALUE as varchar(20))
from INFORMATION_SCHEMA.EXT_SEQUENCES
where SEQUENCE_SCHEMA = '${sequence_schema}'
and SEQUENCE_NAME = '${sequence_name}'
            ]]>
        </Else>
         </SQL>
      </Command>

      <Command id="mimer.getRoutines">
         <SQL>
            <![CDATA[
select ROUTINE_SCHEMA,ROUTINE_NAME,SPECIFIC_NAME,
MODULE_NAME,IS_DETERMINISTIC,SQL_DATA_ACCESS
from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_SCHEMA = '${schema}'
and SPECIFIC_NAME like '${specificname}'
and ROUTINE_TYPE = '${routinetype}'
and MODULE_NAME IS NULL 
]]>
            <!--<If test="#util.isDatabaseVersionGTE(10)">
          <![CDATA[
and TYPE_UDT_NAME IS NULL
]]>
        </If>-->
            <![CDATA[
order by ROUTINE_SCHEMA,ROUTINE_NAME
]]>
         </SQL>
      </Command>

      <!--<Command id="mimer.getRoutinesForUdt">
      <SQL>
        <![CDATA[
select ROUTINE_SCHEMA,ROUTINE_NAME,SPECIFIC_NAME,
MODULE_NAME,IS_DETERMINISTIC,SQL_DATA_ACCESS
from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_SCHEMA = '${schema}'
and SPECIFIC_NAME like '${specificname}'
and ROUTINE_TYPE = '${routinetype}'
and MODULE_NAME IS NULL
and TYPE_UDT_SCHEMA = '${schema}'
and TYPE_UDT_NAME = '${udtname}'
order by ROUTINE_SCHEMA,ROUTINE_NAME
            ]]>
      </SQL>
    </Command>-->

      <Command id="mimer.getUDTRoutinesAll">
         <SQL>
            <![CDATA[
select MS.SPECIFIC_SCHEMA,MS.SPECIFIC_NAME,MS.UDT_SCHEMA,MS.UDT_NAME,MS.METHOD_NAME,MS.IS_OVERRIDING,
case when MS.DATA_TYPE = 'USER-DEFINED' then
     case when RETURN_UDT_SCHEMA = CURRENT_USER then '' else RETURN_UDT_SCHEMA || '.' end ||
     RETURN_UDT_NAME collate SQL_IDENTIFIER
else MS.DATA_TYPE collate SQL_IDENTIFIER ||
case MS.DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case MS.INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(MS.INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(MS.INTERVAL_PRECISION as varchar(2)) || ', ' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || MS.INTERVAL_TYPE || '(' || cast(MS.INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(MS.NUMERIC_PRECISION as varchar(2)) || ', ' || cast(MS.NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(MS.NUMERIC_PRECISION as varchar(2)) || ', ' || cast(MS.NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end collate SQL_IDENTIFIER
end as DATA_TYPE,
MS.COLLATION_SCHEMA,MS.COLLATION_NAME,
MS.METHOD_LANGUAGE,MS.IS_DETERMINISTIC,MS.SQL_DATA_ACCESS,MS.CREATED,MS.LAST_ALTERED
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS MS
where MS.UDT_SCHEMA = '${schema}'
and MS.UDT_NAME = '${udtname}'
and case when IS_STATIC = 'YES' then 'STATIC METHOD'
    else case when IS_CONSTRUCTOR = 'YES' 
         then 'CONSTRUCTOR METHOD'
         else 'INSTANCE METHOD'
         end
    end = '${routinetype}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getUDTRoutinesUndef">
         <SQL>
            <![CDATA[
select MS.SPECIFIC_SCHEMA,MS.SPECIFIC_NAME,MS.UDT_SCHEMA,MS.UDT_NAME,MS.METHOD_NAME,MS.IS_OVERRIDING,
case when MS.DATA_TYPE = 'USER-DEFINED' then
     case when RETURN_UDT_SCHEMA = CURRENT_USER then '' else RETURN_UDT_SCHEMA || '.' end ||
     RETURN_UDT_NAME collate SQL_IDENTIFIER
else MS.DATA_TYPE collate SQL_IDENTIFIER ||
case MS.DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case MS.INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(MS.INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(MS.INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(MS.INTERVAL_PRECISION as varchar(2)) || ', ' || cast(MS.DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || MS.INTERVAL_TYPE || '(' || cast(MS.INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(MS.NUMERIC_PRECISION as varchar(2)) || ', ' || cast(MS.NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(MS.NUMERIC_PRECISION as varchar(2)) || ', ' || cast(MS.NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end collate SQL_IDENTIFIER
end as DATA_TYPE,
MS.COLLATION_SCHEMA,MS.COLLATION_NAME,
MS.METHOD_LANGUAGE,MS.IS_DETERMINISTIC,MS.SQL_DATA_ACCESS,MS.CREATED,MS.LAST_ALTERED
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS MS
where MS.UDT_SCHEMA = '${schema}'
and MS.UDT_NAME = '${udtname}'
and case when IS_STATIC = 'YES' then 'STATIC METHOD'
    else case when IS_CONSTRUCTOR = 'YES' 
         then 'CONSTRUCTOR METHOD'
         else 'INSTANCE METHOD'
         end
    end = '${routinetype}'
and not exists (select routine_name from INFORMATION_SCHEMA.ROUTINES R
where MS.UDT_SCHEMA = R.UDT_SCHEMA
and MS.UDT_SCHEMA = R.ROUTINE_SCHEMA
and MS.UDT_NAME = R.UDT_NAME
and MS.SPECIFIC_SCHEMA = R.SPECIFIC_SCHEMA
and MS.SPECIFIC_NAME = R.SPECIFIC_NAME
and MS.METHOD_NAME = R.ROUTINE_NAME)
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getUDTRoutines">
         <SQL>
            <![CDATA[
select SPECIFIC_SCHEMA,SPECIFIC_NAME,UDT_SCHEMA,UDT_NAME,ROUTINE_NAME as METHOD_NAME,
case when DATA_TYPE = 'USER-DEFINED' then
     case when TYPE_UDT_SCHEMA = CURRENT_USER then '' else TYPE_UDT_SCHEMA || '.' end ||
     TYPE_UDT_NAME collate SQL_IDENTIFIER
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end collate SQL_IDENTIFIER
end as DATA_TYPE,
COLLATION_SCHEMA,COLLATION_NAME,
ROUTINE_BODY as METHOD_LANGUAGE,IS_DETERMINISTIC,SQL_DATA_ACCESS
from INFORMATION_SCHEMA.ROUTINES
where SPECIFIC_SCHEMA = '${schema}'
and UDT_SCHEMA = '${schema}'
and UDT_NAME = '${udtname}'
and ROUTINE_TYPE = '${routinetype}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getRoutineFacts">
         <SQL>
            select
            R.ROUTINE_SCHEMA,R.ROUTINE_NAME,R.SPECIFIC_NAME,OIU.CREATION_DATE,
            <If test="#util.isDatabaseVersionGTE(10)">
               IS_IMPLICIT,
            </If>
            OIU.REMARKS
            from INFORMATION_SCHEMA.ROUTINES R left outer join
            INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE OIU
            on (R.ROUTINE_SCHEMA = OIU.OBJECT_SCHEMA and
            R.ROUTINE_NAME = OIU.OBJECT_NAME and
            <If test="#util.isDatabaseVersionGTE(9,3)">
               R.SPECIFIC_NAME = OIU.SPECIFIC_NAME and
            </If>
            '${routinetype}' = OIU.OBJECT_TYPE)
            where R.ROUTINE_SCHEMA = '${schema}'
            and R.SPECIFIC_SCHEMA = '${schema}'
            and R.ROUTINE_TYPE = '${routinetype}'
            and R.MODULE_NAME IS NULL
            order by ROUTINE_SCHEMA,ROUTINE_NAME
         </SQL>
      </Command>

      <Command id="mimer.getRoutineInfo">
         <SQL>
            select ROUTINE_SCHEMA,ROUTINE_NAME,SPECIFIC_NAME,MODULE_NAME,
            <If test="#util.isDatabaseVersionGTE(10)">
               case when DATA_TYPE = 'USER-DEFINED' then
               case when TYPE_UDT_SCHEMA = CURRENT_USER then '' else
               TYPE_UDT_SCHEMA || '.' end ||
               TYPE_UDT_NAME
               else
            </If>
            DATA_TYPE
            <If test="#util.isDatabaseVersionGTE(10)">
               collate SQL_IDENTIFIER
            </If>
            ||
            case DATA_TYPE
            when 'DOUBLE PRECISION' then ''
            when 'REAL' then ''
            when 'FLOAT' then ''
            when 'INTEGER' then ''
            when 'SMALLINT' then ''
            when 'BIGINT' then ''
            when 'DATE' then ''
            when 'INTERVAL'
            then case INTERVAL_TYPE
            when 'YEAR TO MONTH' then ' YEAR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MONTH'
            when 'DAY TO HOUR' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO HOUR'
            when 'DAY TO MINUTE' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'DAY TO SECOND' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'HOUR TO MINUTE' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'HOUR TO SECOND' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'MINUTE TO SECOND' then ' MINUTE(' || cast(INTERVAL_PRECISION
            as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'SECOND' then ' SECOND(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
            else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ')'
            end
            when 'DECIMAL' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            when 'NUMERIC' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) is NULL then ''
            else '(' ||
            cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) as varchar(20)) || ')'
            end
            end
            <If test="#util.isDatabaseVersionGTE(10)">
               end
            </If>
            as DATA_TYPE,
            COLLATION_SCHEMA,COLLATION_NAME,IS_DETERMINISTIC,SQL_DATA_ACCESS,ROUTINE_BODY
            from INFORMATION_SCHEMA.ROUTINES R
            where ROUTINE_SCHEMA = '${schema}'
            and ROUTINE_NAME = '${objectname}'
            and SPECIFIC_SCHEMA = '${schema}'
            and SPECIFIC_NAME = '${specificname}'
            and ROUTINE_TYPE = '${routinetype}'
         </SQL>
      </Command>

      <Command id="mimer.getRoutineParameters">
         <SQL>
            select PARAMETER_NAME,PARAMETER_MODE,ORDINAL_POSITION,
            <If test="#util.isDatabaseVersionGTE(10)">
               case when DATA_TYPE = 'USER-DEFINED' then
               case when UDT_SCHEMA = CURRENT_USER then '' else UDT_SCHEMA ||
               '.' end ||
               UDT_NAME
               else
            </If>
            <If test="#util.isDatabaseVersionEQ(8)">
               trim (trailing from DATA_TYPE)
            </If>
            <Else>
               DATA_TYPE
            </Else>
            <If test="#util.isDatabaseVersionGTE(10)">
               collate SQL_IDENTIFIER
            </If>
            ||
            case DATA_TYPE
            when 'DOUBLE PRECISION' then ''
            when 'REAL' then ''
            when 'FLOAT' then ''
            when 'INTEGER' then ''
            when 'SMALLINT' then ''
            when 'BIGINT' then ''
            when 'DATE' then ''
            when 'INTERVAL'
            then case INTERVAL_TYPE
            when 'YEAR TO MONTH' then ' YEAR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MONTH'
            when 'DAY TO HOUR' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO HOUR'
            when 'DAY TO MINUTE' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'DAY TO SECOND' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'HOUR TO MINUTE' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'HOUR TO SECOND' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'MINUTE TO SECOND' then ' MINUTE(' || cast(INTERVAL_PRECISION
            as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'SECOND' then ' SECOND(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
            else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ')'
            end
            when 'DECIMAL' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            when 'NUMERIC' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) is NULL then ''
            else '(' ||
            cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) as varchar(20)) || ')'
            end
            end
            <If test="#util.isDatabaseVersionGTE(10)">
               end
            </If>
            as DATA_TYPE,
            COLLATION_SCHEMA,COLLATION_NAME
            from INFORMATION_SCHEMA.PARAMETERS
            where SPECIFIC_SCHEMA = '${schema}'
            and SPECIFIC_NAME = '${specificname}'
            order by ORDINAL_POSITION
         </SQL>
      </Command>

      <Command id="mimer.getRoutineResult">
         <SQL>
            select ROUTINE_SCHEMA,ROUTINE_NAME,
            <If test="#util.isDatabaseVersionGTE(10)">
               case when DATA_TYPE = 'USER-DEFINED' then
               case when TYPE_UDT_SCHEMA = CURRENT_USER then '' else
               TYPE_UDT_SCHEMA || '.' end ||
               TYPE_UDT_NAME
               else
            </If>
            <If test="#util.isDatabaseVersionEQ(8)">
               trim (trailing from DATA_TYPE)
            </If>
            <Else>
               DATA_TYPE
            </Else>
            <If test="#util.isDatabaseVersionGTE(10)">
               collate SQL_IDENTIFIER
            </If>
            ||
            case DATA_TYPE
            when 'DOUBLE PRECISION' then ''
            when 'REAL' then ''
            when 'FLOAT' then ''
            when 'INTEGER' then ''
            when 'SMALLINT' then ''
            when 'BIGINT' then ''
            when 'DATE' then ''
            when 'INTERVAL'
            then case INTERVAL_TYPE
            when 'YEAR TO MONTH' then ' YEAR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MONTH'
            when 'DAY TO HOUR' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO HOUR'
            when 'DAY TO MINUTE' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'DAY TO SECOND' then ' DAY(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'HOUR TO MINUTE' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO MINUTE'
            when 'HOUR TO SECOND' then ' HOUR(' || cast(INTERVAL_PRECISION as
            varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'MINUTE TO SECOND' then ' MINUTE(' || cast(INTERVAL_PRECISION
            as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as
            varchar(1)) || ')'
            when 'SECOND' then ' SECOND(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
            else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as
            varchar(2)) || ')'
            end
            when 'DECIMAL' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            when 'NUMERIC' then '(' || cast(NUMERIC_PRECISION as varchar(2)) ||
            ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
            else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) is NULL then ''
            else '(' ||
            cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
            <If test="#util.isDatabaseVersionGTE(9)">
               LOB_MAXIMUM_LENGTH,
            </If>
            DATETIME_PRECISION) as varchar(20)) || ')'
            end
            end
            <If test="#util.isDatabaseVersionGTE(10)">
               end
            </If>
            as DATA_TYPE,
            COLLATION_SCHEMA,COLLATION_NAME
            from INFORMATION_SCHEMA.ROUTINES
            where ROUTINE_SCHEMA = '${schema}'
            and ROUTINE_NAME = '${objectname}'
            and SPECIFIC_SCHEMA = '${schema}'
            and SPECIFIC_NAME = '${specificname}'
            and ROUTINE_TYPE = '${routinetype}'
         </SQL>
      </Command>

      <Command id="mimer.getModules">
         <SQL>
            <![CDATA[
select MODULE_SCHEMA,MODULE_NAME
from INFORMATION_SCHEMA.MODULES
where MODULE_SCHEMA = '${module_schema}'
order by MODULE_SCHEMA, MODULE_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getModuleFacts">
         <SQL>
            <![CDATA[
select MODULE_SCHEMA,MODULE_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.MODULES left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (MODULE_SCHEMA = OBJECT_SCHEMA and
    MODULE_NAME = OBJECT_NAME and
    'MODULE' = OBJECT_TYPE)
where MODULE_SCHEMA = '${schema}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getModuleInfo">
         <SQL>
            <![CDATA[
select MODULE_SCHEMA,MODULE_NAME,DEFAULT_SCHEMA
from INFORMATION_SCHEMA.MODULES
where MODULE_SCHEMA = '${module_schema}'
and MODULE_NAME = '${module_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getModuleRoutines">
         <SQL>
            <![CDATA[
select MODULE_SCHEMA,MODULE_NAME,ROUTINE_SCHEMA,ROUTINE_NAME,ROUTINE_TYPE,IS_RESULT
from INFORMATION_SCHEMA.ROUTINES
where MODULE_SCHEMA = '${module_schema}'
and MODULE_NAME = '${module_name}'
order by ROUTINE_SCHEMA,ROUTINE_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getModuleRoutinesByType">
         <SQL>
            <![CDATA[
select MODULE_SCHEMA,MODULE_NAME,ROUTINE_SCHEMA,ROUTINE_NAME,ROUTINE_TYPE,IS_RESULT,SPECIFIC_NAME
from INFORMATION_SCHEMA.ROUTINES
where MODULE_SCHEMA = '${module_schema}'
and MODULE_NAME = '${module_name}'
and ROUTINE_TYPE = '${routine_type}'
order by ROUTINE_SCHEMA,ROUTINE_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTriggers">
         <SQL>
            <![CDATA[
select TRIGGER_SCHEMA,TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_SCHEMA,EVENT_OBJECT_TABLE,
ACTION_ORIENTATION,]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[ACTION_TIMING]]>
            </If>
            <Else>
               <![CDATA[CONDITION_TIMING]]>
            </Else>
            <![CDATA[
from INFORMATION_SCHEMA.TRIGGERS
where TRIGGER_SCHEMA = '${trigger_schema}'
and EVENT_OBJECT_TABLE LIKE '${tableNamePattern}'
order by TRIGGER_SCHEMA,TRIGGER_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTriggerFacts">
         <SQL>
            <![CDATA[
select TRIGGER_SCHEMA,TRIGGER_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.TRIGGERS left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (TRIGGER_SCHEMA = OBJECT_SCHEMA and
    TRIGGER_NAME = OBJECT_NAME and
    'TRIGGER' = OBJECT_TYPE)
where TRIGGER_SCHEMA = '${schema}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTriggerInfo">
         <SQL>
            <![CDATA[
select TRIGGER_SCHEMA,TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_SCHEMA,EVENT_OBJECT_TABLE,
ACTION_ORDER,ACTION_CONDITION,ACTION_ORIENTATION,]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[ACTION_TIMING,ACTION_REFERENCE_OLD_TABLE,ACTION_REFERENCE_NEW_TABLE,]]>
            </If>
            <Else>
               <![CDATA[CONDITION_TIMING,CONDITION_REFERENCE_OLD_TABLE,CONDITION_REFERENCE_NEW_TABLE,]]>
            </Else>
            <![CDATA[
COLUMN_LIST_IS_IMPLICIT
from INFORMATION_SCHEMA.TRIGGERS
where TRIGGER_SCHEMA = '${trigger_schema}'
and TRIGGER_NAME = '${trigger_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableTriggers">
         <SQL>
            <![CDATA[
select TRIGGER_SCHEMA,TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_SCHEMA,EVENT_OBJECT_TABLE,
ACTION_ORDER,ACTION_CONDITION,ACTION_ORIENTATION,]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[ACTION_TIMING,ACTION_REFERENCE_OLD_TABLE,ACTION_REFERENCE_NEW_TABLE,]]>
            </If>
            <Else>
               <![CDATA[CONDITION_TIMING,CONDITION_REFERENCE_OLD_TABLE,CONDITION_REFERENCE_NEW_TABLE,]]>
            </Else>
            <![CDATA[COLUMN_LIST_IS_IMPLICIT,CREATED
from INFORMATION_SCHEMA.TRIGGERS
where EVENT_OBJECT_SCHEMA = '${object_schema}' and EVENT_OBJECT_TABLE = '${object_table}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDomains">
         <SQL>
            <![CDATA[
select D.DOMAIN_SCHEMA,D.DOMAIN_NAME,
coalesce(INTERVAL_TYPE,DATA_TYPE) as DATA_TYPE,case when DOMAIN_DEFAULT is null then '' else DOMAIN_DEFAULT end as DOMAIN_DEFAULT
from INFORMATION_SCHEMA.DOMAINS D
where D.DOMAIN_SCHEMA = '${domain_schema}'
order by D.DOMAIN_SCHEMA,D.DOMAIN_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDomainFacts">
         <SQL>
            <![CDATA[
select D.DOMAIN_SCHEMA,D.DOMAIN_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.DOMAINS D left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (DOMAIN_SCHEMA = OBJECT_SCHEMA and
    DOMAIN_NAME = OBJECT_NAME and
    'DOMAIN' = OBJECT_TYPE)
where D.DOMAIN_SCHEMA = '${schema}'
order by D.DOMAIN_SCHEMA,D.DOMAIN_NAME
         ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDomainInfo">
         <SQL>
            <If test="#util.isDatabaseVersionLT(9)">
               <![CDATA[
select D.DOMAIN_SCHEMA,D.DOMAIN_NAME,
coalesce(INTERVAL_TYPE,DATA_TYPE) as DATA_TYPE,
coalesce(NUMERIC_PRECISION, CHARACTER_MAXIMUM_LENGTH,INTERVAL_PRECISION) as "PRECISION",
coalesce(NUMERIC_SCALE,DATETIME_PRECISION) as SCALE,
DOMAIN_DEFAULT
from INFORMATION_SCHEMA.DOMAINS D
where D.DOMAIN_SCHEMA = '${domain_schema}'
and D.DOMAIN_NAME = '${domain_name}'
               ]]>
            </If>
            <Else>
               <![CDATA[
select D.DOMAIN_SCHEMA,D.DOMAIN_NAME,
coalesce(INTERVAL_TYPE,DATA_TYPE) as DATA_TYPE,
coalesce(NUMERIC_PRECISION, CHARACTER_MAXIMUM_LENGTH,INTERVAL_PRECISION,LOB_MAXIMUM_LENGTH) as "PRECISION",
coalesce(NUMERIC_SCALE,DATETIME_PRECISION) as SCALE,
DOMAIN_DEFAULT
from INFORMATION_SCHEMA.DOMAINS D
where D.DOMAIN_SCHEMA = '${domain_schema}'
and D.DOMAIN_NAME = '${domain_name}'
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getDomainConstraints">
         <SQL>
            <![CDATA[
select DOMAIN_SCHEMA,DOMAIN_NAME,DC.CONSTRAINT_SCHEMA,DC.CONSTRAINT_NAME,IS_DEFERRABLE,INITIALLY_DEFERRED
from INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.DOMAIN_SCHEMA = '${domain_schema}'
and DC.DOMAIN_NAME = '${domain_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDomainUsed">
         <SQL>
             <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <!-- Workaround for union all (fixed in 9.2) -->
               <![CDATA[
select USING_OBJECT_SCHEMA,USING_OBJECT_NAME,null as COLUMN_NAME,USING_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_SCHEMA = '${object_schema}'
and   USED_OBJECT_NAME   = '${object_name}'
and   USED_OBJECT_TYPE   = '${object_type}'
union
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,'COLUMN'
from INFORMATION_SCHEMA.COLUMN_DOMAIN_USAGE
where DOMAIN_SCHEMA = '${object_schema}'
and DOMAIN_NAME = '${object_name}'
order by USING_OBJECT_SCHEMA,USING_OBJECT_NAME
               ]]>
            </If>
            <Else>
               <![CDATA[
select USING_OBJECT_SCHEMA,USING_OBJECT_NAME,null as COLUMN_NAME,USING_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_SCHEMA = '${object_schema}'
and   USED_OBJECT_NAME   = '${object_name}'
and   USED_OBJECT_TYPE   = '${object_type}'
union all
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,'COLUMN'
from INFORMATION_SCHEMA.COLUMN_DOMAIN_USAGE
where DOMAIN_SCHEMA = '${object_schema}'
and DOMAIN_NAME = '${object_name}'
order by USING_OBJECT_SCHEMA,USING_OBJECT_NAME
               ]]>
            </Else>
         </SQL>
      </Command>
      <!--
         The query uses INFORMATION_SCHEMA.COLUMNS to pick up usage of collations.
         This has two (unwanted) sideffects:

         1) The owner of a collation only sees uses where he/she has access to table/view (rather
            than seeing any use of the collation).
         2) Non-owners see objects that are owned by other users where he/she has access to table/view.
            The second issue is handled in the or-clause below.

         There is currently no INFORMATION_SCHEMA view that handles this correctly (for domains, that has
         the same issue, this is done in INFORMATION_SCHEMA.COLUMN_DOMAIN_USAGE).
       -->

      <Command id="mimer.getCollationUsed">
         <SQL>
            <![CDATA[
select USING_OBJECT_SCHEMA,USING_OBJECT_NAME,null as COLUMN_NAME,USING_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_SCHEMA = '${object_schema}'
and   USED_OBJECT_NAME   = '${object_name}'
and   USED_OBJECT_TYPE   = 'COLLATION'
union all
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,'COLUMN'
from INFORMATION_SCHEMA.COLUMNS
where COLLATION_SCHEMA = '${object_schema}'
and COLLATION_NAME = '${object_name}'
and (CURRENT_USER = '${object_schema}' or CURRENT_USER = TABLE_SCHEMA)
order by USING_OBJECT_SCHEMA,USING_OBJECT_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDomainSource">
         <SQL>
            <If test="#util.isDatabaseVersionLT(9)">
               <![CDATA[
select 'create domain "' ||
case when DOMAIN_SCHEMA = CURRENT_USER then '' else DOMAIN_SCHEMA || '"."' end ||
D.DOMAIN_NAME || '" as ' || DATA_TYPE ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end ||
case when DOMAIN_DEFAULT is not null and DOMAIN_DEFAULT <> 'TRUNCATED' then ascii_char(10) || '     default ' || DOMAIN_DEFAULT
     else ''
     end,
'' as CONSTRAINT_NAME,
0 as LINE_NUMBER
from INFORMATION_SCHEMA.DOMAINS D
where D.DOMAIN_SCHEMA = '${domain_schema}'
and D.DOMAIN_NAME = '${domain_name}'
union all
select case when SD3.LINE_NUMBER = 1
            then ascii_char(10) || '     default '
            else ''
            end ||
            SD3.SOURCE_DEFINITION,
       '',
       SD3.LINE_NUMBER
from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD3
where OBJECT_SCHEMA = '${domain_schema}'
and   OBJECT_NAME = '${domain_name}'
and   OBJECT_TYPE = 'DOMAIN'
union all
select ascii_char(10) || '     constraint "' || CC.CONSTRAINT_NAME || '" check(' || CC.CHECK_CLAUSE || ')', CC.CONSTRAINT_NAME, 1
from INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.DOMAIN_SCHEMA = '${domain_schema}'
and DC.DOMAIN_NAME = '${domain_name}'
and CC.CHECK_CLAUSE is not null
union all
select case when SD.LINE_NUMBER = 1
            then ascii_char(10) || '     constraint "' || CC.CONSTRAINT_NAME || '" check('
            else ''
            end ||
       SD.SOURCE_DEFINITION ||
       case when SD.LINE_NUMBER = (select max(LINE_NUMBER) from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD2
                                   where SD2.OBJECT_SCHEMA = SD.OBJECT_SCHEMA
                                   and SD2.OBJECT_NAME = SD.OBJECT_NAME)
            then ')'
            else ''
            end, CC.CONSTRAINT_NAME, LINE_NUMBER
from INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
join INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD
on (CC.CONSTRAINT_SCHEMA = SD.OBJECT_SCHEMA and
    CC.CONSTRAINT_NAME = SD.OBJECT_NAME)
where DC.DOMAIN_SCHEMA = '${domain_schema}'
and DC.DOMAIN_NAME = '${domain_name}'
and CC.CHECK_CLAUSE is null
order by CONSTRAINT_NAME, LINE_NUMBER
               ]]>
            </If>
            <Else>
               <![CDATA[
select 'create domain "' ||
case when DOMAIN_SCHEMA = CURRENT_USER then '' else DOMAIN_SCHEMA || '"."' end ||
D.DOMAIN_NAME || '" as ' || DATA_TYPE ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end ||
case when COLLATION_NAME is not null and (
          (COLLATION_SCHEMA <> 'INFORMATION_SCHEMA' or
           (COLLATION_NAME <> 'ISO8BIT' and COLLATION_NAME <> 'UCS_BASIC'))) then ' collate "' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"'
     else ''
     end ||
case when DOMAIN_DEFAULT is not null and DOMAIN_DEFAULT <> 'TRUNCATED' then ascii_char(10) || '     default ' || DOMAIN_DEFAULT
     else ''
     end,
'' as CONSTRAINT_NAME,
0  as LINE_NUMBER
from INFORMATION_SCHEMA.DOMAINS D
where D.DOMAIN_SCHEMA = '${domain_schema}'
and D.DOMAIN_NAME = '${domain_name}'
union all
select case when SD3.LINE_NUMBER = 1
            then ascii_char(10) || '     default '
            else ''
            end ||
            SD3.SOURCE_DEFINITION
          ]]>
               <If test="#util.isDatabaseVersionGTE(10)">
                  <![CDATA[ collate SQL_IDENTIFIER ]]>
               </If>
               <![CDATA[
       ,'',
       SD3.LINE_NUMBER
from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD3
where OBJECT_SCHEMA = '${domain_schema}'
and   OBJECT_NAME = '${domain_name}'
and   OBJECT_TYPE = 'DOMAIN'
union all
select ascii_char(10) || '     constraint "' || CC.CONSTRAINT_NAME || '" check(' || CC.CHECK_CLAUSE || ')', CC.CONSTRAINT_NAME, 1
from INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
where DC.DOMAIN_SCHEMA = '${domain_schema}'
and DC.DOMAIN_NAME = '${domain_name}'
and CC.CHECK_CLAUSE is not null
union all
select case when SD.LINE_NUMBER = 1
            then ascii_char(10) || '     constraint "' || CC.CONSTRAINT_NAME || '" check('
            else ''
            end ||
       SD.SOURCE_DEFINITION ||
       case when SD.LINE_NUMBER = (select max(LINE_NUMBER) from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD2
                                   where SD2.OBJECT_SCHEMA = SD.OBJECT_SCHEMA
                                   and SD2.OBJECT_NAME = SD.OBJECT_NAME)
            then ')'
            else ''
            end, CC.CONSTRAINT_NAME, LINE_NUMBER
from INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS DC
join INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
on (DC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA and
    DC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME)
join INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION SD
on (CC.CONSTRAINT_SCHEMA = SD.OBJECT_SCHEMA and
    CC.CONSTRAINT_NAME = SD.OBJECT_NAME)
where DC.DOMAIN_SCHEMA = '${domain_schema}'
and DC.DOMAIN_NAME = '${domain_name}'
and CC.CHECK_CLAUSE is null
order by CONSTRAINT_NAME, LINE_NUMBER
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getCollations">
         <SQL>
            <![CDATA[
select COLLATION_SCHEMA,COLLATION_NAME,CHARACTER_SET_SCHEMA,CHARACTER_SET_NAME,PAD_ATTRIBUTE
from INFORMATION_SCHEMA.COLLATIONS
where COLLATION_SCHEMA = '${collation_schema}'
order by COLLATION_SCHEMA,COLLATION_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getCollationFacts">
         <SQL>
            <![CDATA[
select COLLATION_SCHEMA,COLLATION_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.COLLATIONS left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (OBJECT_SCHEMA = COLLATION_SCHEMA and
    OBJECT_NAME = COLLATION_NAME and
    OBJECT_TYPE = 'COLLATION')
where COLLATION_SCHEMA = '${schema}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getCollationInfo">
         <SQL>
            <![CDATA[
select COLLATION_SCHEMA,COLLATION_NAME,CHARACTER_SET_SCHEMA,CHARACTER_SET_NAME,PAD_ATTRIBUTE
from INFORMATION_SCHEMA.COLLATIONS
where COLLATION_SCHEMA = '${collation_schema}'
and COLLATION_NAME = '${collation_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getCollationSource">
         <SQL>
            <![CDATA[
select 'create collation "' ||
       case when COLLATION_SCHEMA = CURRENT_USER then '' else COLLATION_SCHEMA || '"."' end ||
       '${collation_name}"'  || ascii_char(10) ||
       '     from  "' || BASE_COLLATION_SCHEMA || '"."' || BASE_COLLATION_NAME || '"' || ascii_char(10) ||
       '     using ''' || COLLATION_DEFINITION,COLLATION_SEQNO
from INFORMATION_SCHEMA.EXT_COLLATION_DEFINITIONS
where COLLATION_SCHEMA = '${collation_schema}'
and COLLATION_NAME = '${collation_name}'
and COLLATION_SEQNO = 1
union all
select COLLATION_DEFINITION,COLLATION_SEQNO
from INFORMATION_SCHEMA.EXT_COLLATION_DEFINITIONS
where COLLATION_SCHEMA = '${collation_schema}'
and COLLATION_NAME = '${collation_name}'
and COLLATION_SEQNO > 1
union all
select '''',10000 from INFORMATION_SCHEMA.EXT_ONEROW
order by COLLATION_SEQNO
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getCollationQuotedList">
         <SQL>
            <![CDATA[
select ''
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'CURRENT_COLLATION_1'
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'CURRENT_COLLATION_2'
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'CURRENT_COLLATION_3'
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '"' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"'
from INFORMATION_SCHEMA.COLLATIONS
                 ]]>
         </SQL>
      </Command>

      <Command id="mimer.getCollationList">
         <SQL>
            <![CDATA[
select ''
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'CURRENT_COLLATION_1'
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'CURRENT_COLLATION_2'
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'CURRENT_COLLATION_3'
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select case when COLLATION_SCHEMA = 'INFORMATION_SCHEMA' then '' else COLLATION_SCHEMA || '.' end || COLLATION_NAME
from INFORMATION_SCHEMA.COLLATIONS
                 ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDefaultList">
         <SQL>
            <![CDATA[
select '' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'next_value of "' || SEQUENCE_SCHEMA || '"."' || SEQUENCE_NAME || '"'
from INFORMATION_SCHEMA.EXT_SEQUENCES
]]>
         </SQL>
      </Command>

      <Command id="mimer.getIndexList">
         <SQL>
            <![CDATA[
select INDEX_NAME
from INFORMATION_SCHEMA.EXT_INDEXES
where INDEX_SCHEMA = '${schema}'
and TABLE_NAME = '${objectname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getDataTypeList">
         <SQL>
            <![CDATA[
select distinct trim(trailing from 
case when POSITION('()' IN TYPE_NAME) <> 0 then case when CREATE_PARAMS = 'precision,precision' then REPLACE(TYPE_NAME, '()', '(p)') || '(s)'
                                                     when CREATE_PARAMS = 'precision' then REPLACE(TYPE_NAME, '()', '(p)')
                                                     else TYPE_NAME end 
else TYPE_NAME || 
     case when CREATE_PARAMS in ('precision','length')  then '(p)'
          when CREATE_PARAMS = 'precision,precision' then '(p, s)'
          when CREATE_PARAMS = 'precision,scale' then '(p, s)'
          when CREATE_PARAMS = 'precision' then '(p)'
          else '' end
end)
from MIMER.ODBC3_GETTYPEINFO
]]>
         </SQL>
      </Command>

      <Command id="mimer.getDataTypeListByType">
         <SQL>
            <![CDATA[
select distinct trim(trailing from
case when POSITION('()' IN TYPE_NAME) <> 0 then case when CREATE_PARAMS = 'precision,precision' then REPLACE(TYPE_NAME, '()', '(p)') || '(s)'
                                                   when CREATE_PARAMS = 'precision' then REPLACE(TYPE_NAME, '()', '(p)')
                                                   else TYPE_NAME end
else TYPE_NAME ||
   case when CREATE_PARAMS in ('precision','length')  then '(p)'
        when CREATE_PARAMS = 'precision,precision' then '(p, s)'
        when CREATE_PARAMS = 'precision,scale' then '(p, s)'
        when CREATE_PARAMS = 'precision' then '(p)'
        else '' end
end) as DATA_TYPE
from MIMER.ODBC3_GETTYPEINFO
]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[
where TYPE_CATEGORY in (${type_categories})
]]>
            </If>
order by DATA_TYPE
         </SQL>
      </Command>

      <Command id="mimer.getDataTypes">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[
select distinct TYPE_NAME
from MIMER.ODBC3_GETTYPEINFO
where TYPE_CATEGORY in (${type_categories})
order by TYPE_NAME
]]>
            </If>
            <Else>
               <![CDATA[
select distinct TYPE_NAME
from MIMER.ODBC3_GETTYPEINFO
where INTERNAL_TYPEORDER < 1000
order by TYPE_NAME
]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getDataTypesInfo">
         <SQL>
            <![CDATA[
select distinct TYPE_NAME,trim(trailing from 
case when POSITION('()' IN TYPE_NAME) <> 0 then case when CREATE_PARAMS = 'precision,precision' then REPLACE(TYPE_NAME, '()', '(p)') || '(s)'
                                                     when CREATE_PARAMS = 'precision' then REPLACE(TYPE_NAME, '()', '(p)')
                                                     else TYPE_NAME end 
else TYPE_NAME || 
     case when CREATE_PARAMS in ('precision','length')  then '(p)'
          when CREATE_PARAMS = 'precision,precision' then '(p, s)'
          when CREATE_PARAMS = 'precision,scale' then '(p, s)'
          when CREATE_PARAMS = 'precision' then '(p)'
          else '' end
end) as DATA_TYPE,
case when CASE_SENSITIVE = 0 then 'NO' else 'YES' end as CASE_SENSITIVE,
case SEARCHABLE when 0 then 'NO' when 1 then 'LIKE' when 2 then 'BASIC' when 3 then 'YES' else '?' end as SEARCHABLE,
case when TYPE_NAME in ('TIME','TIMESTAMP') then null
     when CREATE_PARAMS is null then null
     else coalesce(INTERVAL_PRECISION,"PRECISION")
     end as MAXIMUM_PRECISION,
case when MAXIMUM_SCALE = 0 then null
     else MAXIMUM_SCALE
     end as MAXIMUM_SCALE
from MIMER.ODBC3_GETTYPEINFO
where INTERNAL_VERSION > 0
and TYPE_NAME like '${type_name}'
]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
               <![CDATA[and TYPE_CATEGORY in (${type_categories})]]>
            </If>
            <Else>
               <![CDATA[and INTERNAL_TYPEORDER < 1000]]>
            </Else>
order by TYPE_NAME
         </SQL>
      </Command>

      <Command id="mimer.getStatements">
         <SQL>
              <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select STATEMENT_SCHEMA,STATEMENT_NAME
from INFORMATION_SCHEMA.EXT_STATEMENTS
where STATEMENT_SCHEMA = '${statement_schema}'
order by STATEMENT_SCHEMA,STATEMENT_NAME
               ]]>
            </If>
            <Else>
               <![CDATA[
select STATEMENT_SCHEMA,STATEMENT_NAME,IS_SCROLLABLE,IS_FORWARD_ONLY
from INFORMATION_SCHEMA.EXT_STATEMENTS
where STATEMENT_SCHEMA = '${statement_schema}'
order by STATEMENT_SCHEMA,STATEMENT_NAME
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getMobileStatements">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <!-- Version 9.2 or earlier -->
               <![CDATA[execute statement INFORMATION_SCHEMA.ENUM_STATEMENTS]]>
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <![CDATA[INFORMATION_SCHEMA.STATEMENT_ATTRIBUTES]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getStatementFacts">
         <SQL>
            <![CDATA[
select STATEMENT_SCHEMA,STATEMENT_NAME,CREATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_STATEMENTS left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (OBJECT_SCHEMA = STATEMENT_SCHEMA and
    OBJECT_NAME = STATEMENT_NAME and
    OBJECT_TYPE = 'STATEMENT')
where STATEMENT_SCHEMA = '${schema}'
         ]]>
         </SQL>
      </Command>

      <Command id="mimer.getStatementInfo">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select STATEMENT_SCHEMA,STATEMENT_NAME
from INFORMATION_SCHEMA.EXT_STATEMENTS
where STATEMENT_SCHEMA = '${statement_schema}'
and STATEMENT_NAME = '${statement_name}'
           ]]>
            </If>
            <Else>
               <![CDATA[
select STATEMENT_SCHEMA,STATEMENT_NAME,IS_SCROLLABLE,IS_FORWARD_ONLY
from INFORMATION_SCHEMA.EXT_STATEMENTS
where STATEMENT_SCHEMA = '${statement_schema}'
and STATEMENT_NAME = '${statement_name}'
           ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getStatementSource">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select 'create statement "' ||
case when STATEMENT_SCHEMA = CURRENT_USER then '' else STATEMENT_SCHEMA || '"."' end ||
'${statement_name}"' || ascii_char(10) || '     ', 0 as LINE_NUMBER
from INFORMATION_SCHEMA.EXT_STATEMENTS
where STATEMENT_SCHEMA = '${statement_schema}' and
STATEMENT_NAME = '${statement_name}'
union all
select STATEMENT_DEFINITION,STATEMENT_SEQUENCE_NO
from INFORMATION_SCHEMA.EXT_STATEMENT_DEFINITION
where STATEMENT_SCHEMA = '${statement_schema}' and
STATEMENT_NAME = '${statement_name}'
order by LINE_NUMBER
               ]]>
            </If>
            <Else>
               <![CDATA[
select 'create' ||
trim(trailing from
     case when IS_SCROLLABLE = 'NO'
     then ' NO SCROLL'
     else case when IS_FORWARD_ONLY = 'NO'
          then ' SCROLL'
          else ''
          end
     end) || ' statement "' ||
     case when STATEMENT_SCHEMA = CURRENT_USER then '' else STATEMENT_SCHEMA || '"."' end ||
     '${statement_name}"' || ascii_char(10) || '     ' 
          ]]>
               <If test="#util.isDatabaseVersionGTE(10)">
                  <![CDATA[ collate SQL_IDENTIFIER ]]>
               </If>
               <![CDATA[
     , 0 as LINE_NUMBER
from INFORMATION_SCHEMA.EXT_STATEMENTS
where STATEMENT_SCHEMA = '${statement_schema}' and
STATEMENT_NAME = '${statement_name}'
union all
select STATEMENT_DEFINITION,STATEMENT_SEQUENCE_NO
from INFORMATION_SCHEMA.EXT_STATEMENT_DEFINITION
where STATEMENT_SCHEMA = '${statement_schema}' and
STATEMENT_NAME = '${statement_name}'
order by LINE_NUMBER
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getObjectSource">
         <SQL>
            <![CDATA[
select SOURCE_DEFINITION,LINE_NUMBER from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION
where OBJECT_SCHEMA = '${schema}'
and SPECIFIC_NAME = '${specific_name}'
and OBJECT_TYPE = '${type}'
order by LINE_NUMBER
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getObjectSourceByName">
         <SQL>
            <![CDATA[
select SOURCE_DEFINITION,LINE_NUMBER from INFORMATION_SCHEMA.EXT_SOURCE_DEFINITION
where OBJECT_SCHEMA = '${object_schema}'
and OBJECT_NAME = '${object_name}'
and OBJECT_TYPE = '${object_type}'
order by LINE_NUMBER
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getObjectsUsing">
         <SQL>
            <![CDATA[
select USED_OBJECT_SCHEMA,USED_OBJECT_NAME,USED_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USING
where USING_OBJECT_SCHEMA = '${object_schema}'
and   USING_OBJECT_NAME   = '${object_name}'
and   USING_OBJECT_TYPE   = '${object_type}'
order by USED_OBJECT_SCHEMA,USED_OBJECT_NAME
            ]]>
         </SQL>
      </Command>
      <!-- Note that the collate clause overrides all union branches, i.e. only needs to
     be specified once. -->
      <Command id="mimer.getColumnUses">
         <SQL>
            <![CDATA[
select DOMAIN_SCHEMA as USED_OBJECT_SCHEMA,DOMAIN_NAME as USED_OBJECT_NAME,'DOMAIN' as USED_OBJECT_TYPE
from  INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${columnschema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
and DOMAIN_NAME is not null
union all
select trim(both '"' from substring(COLUMN_DEFAULT from 15 for position('"' in substring(COLUMN_DEFAULT from 16))+1))
          ]]>
            <If test="#util.isDatabaseVersionGTE(10)">
               <![CDATA[ collate SQL_IDENTIFIER ]]>
            </If>
            <![CDATA[
      ,trim (both '"' from substring(COLUMN_DEFAULT from 16 + position('"' in substring(COLUMN_DEFAULT from 16))+1))
          ]]>
            <If test="#util.isDatabaseVersionGTE(10)">
               <![CDATA[ collate SQL_IDENTIFIER ]]>
            </If>
            <![CDATA[
      ,'SEQUENCE'
from  INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
and substring(COLUMN_DEFAULT from 1 for 15) = 'NEXT_VALUE OF "'
union all
select trim(both '"' from substring(COLUMN_DEFAULT from 18 for position('"' in substring(COLUMN_DEFAULT from 19))+1)),
       trim (both '"' from substring(COLUMN_DEFAULT from 19 + position('"' in substring(COLUMN_DEFAULT from 19))+1)),
       'SEQUENCE'
from  INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
and substring(COLUMN_DEFAULT from 1 for 18) = 'CURRENT_VALUE OF "'
order by USED_OBJECT_SCHEMA,USED_OBJECT_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableUsed">
         <SQL>
            <![CDATA[
select USING_OBJECT_SCHEMA,USING_OBJECT_NAME,USING_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_SCHEMA = '${object_schema}'
and   USED_OBJECT_NAME   = '${object_name}'
and   USED_OBJECT_TYPE   = '${object_type}'
union
select INDEX_SCHEMA,INDEX_NAME,'INDEX'
from  INFORMATION_SCHEMA.EXT_INDEXES
where INDEX_SCHEMA = '${object_schema}'
and   TABLE_NAME = '${object_name}'
order by USING_OBJECT_SCHEMA,USING_OBJECT_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getObjectsUsed">
         <SQL>
            <![CDATA[
select USING_OBJECT_SCHEMA,USING_OBJECT_NAME,USING_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_SCHEMA = '${object_schema}'
and   USED_OBJECT_NAME   = '${object_name}'
and   USED_OBJECT_TYPE   = '${object_type}'
order by USING_OBJECT_SCHEMA,USING_OBJECT_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getObjectsUsingTable">
         <SQL>
            <![CDATA[
select USED_OBJECT_SCHEMA,USED_OBJECT_NAME,USED_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USING
where USING_OBJECT_SCHEMA = '${object_schema}'
and   USING_OBJECT_NAME   = '${object_name}'
and   USING_OBJECT_TYPE   = '${object_type}'
union all
select DATABANK_CREATOR,DATABANK_NAME,'DATABANK'
from INFORMATION_SCHEMA.EXT_TABLE_DATABANK_USAGE
where TABLE_SCHEMA = '${object_schema}'
and TABLE_NAME = '${object_name}'
order by USED_OBJECT_SCHEMA,USED_OBJECT_NAME
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSchemaObjectRemark">
         <SQL>
            <![CDATA[
select REMARKS
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA = '${schema}'
and OBJECT_NAME = '${objectname}'
and OBJECT_TYPE = '${object_type}'
                  ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSchemaRemark">
         <SQL>
            <![CDATA[
select REMARKS
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA IS NULL
and OBJECT_NAME = '${schema}'
and OBJECT_TYPE = 'SCHEMA'
                  ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSchemaSpecificObjectRemark">
         <SQL>
            <![CDATA[
select REMARKS
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA = '${schema}'
and SPECIFIC_NAME = '${specificname}'
and OBJECT_NAME = '${objectname}'
and OBJECT_TYPE = '${object_type}'
                  ]]>
         </SQL>
      </Command>

      <Command id="mimer.getObjectRemark">
         <SQL>
            <![CDATA[
select REMARKS
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA is null
and OBJECT_NAME = '${objectname}'
and OBJECT_TYPE = '${object_type}'
                  ]]>
         </SQL>
      </Command>

      <Command id="mimer.getGranteeForObjectPrivileges">
         <SQL>
            <![CDATA[
select GRANTEE
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where OBJECT_NAME =     '${objectname}'
and   OBJECT_TYPE =     '${object_type}'
and   PRIVILEGE_TYPE in ('${privilege_type}')
and   GRANTOR = CURRENT_USER
]]>
         </SQL>
      </Command>

      <Command id="mimer.getPrivilegesForObjectPrivileges">
         <SQL>
            <![CDATA[
select distinct PRIVILEGE_TYPE
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where OBJECT_NAME =     '${objectname}'
and   OBJECT_TYPE =     '${object_type}'
and   GRANTOR = CURRENT_USER
]]>
         </SQL>
      </Command>

      <Command id="mimer.getGranteeForSchemaObjectPrivileges">
         <SQL>
            <![CDATA[
select GRANTEE
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where OBJECT_SCHEMA =  '${schema}'
and   OBJECT_NAME =    '${objectname}'
and   OBJECT_TYPE =    '${object_type}'
and   PRIVILEGE_TYPE = '${privilege_type}'
and   GRANTOR = CURRENT_USER
]]>
         </SQL>
      </Command>

      <Command id="mimer.getGranteeForRoutineSchemaObjectPrivileges">
         <SQL>
            <![CDATA[
select RP.GRANTEE
from INFORMATION_SCHEMA.ROUTINES R join INFORMATION_SCHEMA.ROUTINE_PRIVILEGES RP
on (R.ROUTINE_SCHEMA = RP.ROUTINE_SCHEMA
and R.ROUTINE_NAME = RP.ROUTINE_NAME
and R.SPECIFIC_SCHEMA = RP.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = RP.SPECIFIC_NAME)
where R.ROUTINE_SCHEMA  = '${schema}'
and   R.ROUTINE_NAME    = '${objectname}'
and   R.SPECIFIC_SCHEMA = '${schema}'
and   R.SPECIFIC_NAME   = '${specificname}'
and   R.ROUTINE_TYPE    = '${object_type}'
and   RP.PRIVILEGE_TYPE in ('${privilege_type}')
and   rp.GRANTOR = CURRENT_USER
]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableByType">
         <SQL>
            <![CDATA[
select TABLE_NAME
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = '${schema}'
and TABLE_TYPE in (${table_type})
]]>
         </SQL>
      </Command>

      <Command id="mimer.getColumnDataType">
         <SQL>
            <![CDATA[
select
case when DOMAIN_NAME is not null then DOMAIN_SCHEMA || '.' || DOMAIN_NAME
else DATA_TYPE]]>
            <If test="#util.isDatabaseVersionGTE(10)">
               <![CDATA[ collate SQL_IDENTIFIER]]>
            </If>
            <![CDATA[ ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,]]>
            <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[ LOB_MAXIMUM_LENGTH, ]]>
            </If>
            <![CDATA[        DATETIME_PRECISION) is NULL then ''
        else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,
        ]]>
            <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[ LOB_MAXIMUM_LENGTH,]]>
            </If>
            <![CDATA[ DATETIME_PRECISION) as varchar(20)) || ')'
end
end
end
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getColumnDefault">
         <SQL>
            <![CDATA[
select COLUMN_DEFAULT from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getSessionProperties">
         <SQL>
            <![CDATA[
          select 'Current user' as "Parameter", CURRENT_USER as "Value" from INFORMATION_SCHEMA.EXT_ONEROW
union all select 'Session user', SESSION_USER from INFORMATION_SCHEMA.EXT_ONEROW
union all select 'Entered program', CURRENT_PROGRAM() from INFORMATION_SCHEMA.EXT_ONEROW
union all select 'Server Time', substring(cast(cast(LOCALTIMESTAMP as TIMESTAMP(2)) as varchar(33)) from 11 for 22) from INFORMATION_SCHEMA.EXT_ONEROW
]]>
         </SQL>
      </Command>

      <Command id="mimer.getOsUsersForIdent">
        <SQL>
          <![CDATA[
select IDENT_LOGIN as OS_USER,IDENT_NAME
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_NAME = '${objectname}'
and   IDENT_LOGIN is not null
]]>
        </SQL>
      </Command>

      <!-- ================================================================= -->
      <!-- DBA related commands requiring certain privileges in the database -->
      <!-- ================================================================= -->

      <Command id="mimer.getServerInfo">
         <SQL>
            <![CDATA[select SERVER_ATTRIBUTE,ATTRIBUTE_VALUE from SYSTEM.SERVER_INFO]]>
         </SQL>
      </Command>

      <!-- When selecting all groups append the group PUBLIC as it is not returned by the EXT_IDENTS view -->
      <Command id="mimer.getIdents">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select IDENT_CREATOR,IDENT_NAME,IDENT_TYPE
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_TYPE in (${ident_type})
union
select 'SYSTEM','PUBLIC','GROUP'
from INFORMATION_SCHEMA.EXT_ONEROW
where 'GROUP' in (${ident_type})
               ]]>
            </If>
            <Else>
               <![CDATA[
select IDENT_CREATOR,IDENT_NAME,IDENT_TYPE,IDENT_SCHEMA
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_TYPE in (${ident_type})
union
select 'SYSTEM','PUBLIC','GROUP','NO'
from INFORMATION_SCHEMA.EXT_ONEROW
where 'GROUP' in (${ident_type})
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getIdentFacts">
         <SQL>
            <![CDATA[
select IDENT_NAME,CREATION_DATE,
case when CREATION_DATE <> ALTERATION_DATE then ALTERATION_DATE end as ALTERATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_IDENTS left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (OBJECT_SCHEMA is null and
    OBJECT_NAME = IDENT_NAME and
    OBJECT_TYPE = 'IDENT')
where IDENT_TYPE in (${ident_type})
union
select 'PUBLIC',null,null,null
from INFORMATION_SCHEMA.EXT_ONEROW
where 'GROUP' in (${ident_type})
         ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIdentInfo">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select IDENT_CREATOR,IDENT_NAME,IDENT_TYPE
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_TYPE = '${ident_type}'
and IDENT_NAME = '${ident_name}'
               ]]>
            </If>
            <Else>
          <If test="#util.isDatabaseVersionGTE(10,1)">
           <![CDATA[select distinct IDENT_CREATOR,IDENT_NAME,IDENT_TYPE,IDENT_SCHEMA,HAS_PASSWORD]]>
          </If>
          <Else>
            <![CDATA[select IDENT_CREATOR,IDENT_NAME,IDENT_TYPE,IDENT_SCHEMA]]>
          </Else>
               <![CDATA[
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_TYPE = '${ident_type}'
and IDENT_NAME = '${ident_name}'
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getIdentSchemas">
         <SQL>
            <![CDATA[
select SCHEMA_NAME,SCHEMA_OWNER
from INFORMATION_SCHEMA.SCHEMATA
where SCHEMA_OWNER = '${ident_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSystemPrivileges">
         <SQL>
            <![CDATA[
select GRANTEE,PRIVILEGE_TYPE,GRANTOR,IS_GRANTABLE
from INFORMATION_SCHEMA.EXT_SYSTEM_PRIVILEGES
where GRANTEE = ${grantee}
]]>
         </SQL>
      </Command>

      <Command id="mimer.getSystemPrivilegesToRevoke">
         <SQL>
            <![CDATA[
select trim(trailing from PRIVILEGE_TYPE)
from INFORMATION_SCHEMA.EXT_SYSTEM_PRIVILEGES
where GRANTEE = '${objectname}'
and GRANTOR = CURRENT_USER
                 ]]>
         </SQL>
      </Command>

      <Command id="mimer.getObjectPrivileges">
         <SQL>
            <![CDATA[
select GRANTEE,OBJECT_SCHEMA,OBJECT_NAME,OBJECT_TYPE,PRIVILEGE_TYPE,GRANTOR,IS_GRANTABLE
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where OBJECT_SCHEMA =    '${object_schema}'
and   OBJECT_NAME =      '${object_name}'
and   OBJECT_TYPE =      '${object_type}'
and   PRIVILEGE_TYPE in ('${privilege_type}')
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getRoutinePrivileges">
         <SQL>
            <![CDATA[
select RP.GRANTEE,RP.ROUTINE_SCHEMA as OBJECT_SCHEMA,RP.ROUTINE_NAME as OBJECT_NAME,RP.SPECIFIC_NAME,R.ROUTINE_TYPE as OBJECT_TYPE,RP.PRIVILEGE_TYPE,RP.GRANTOR,RP.IS_GRANTABLE
from INFORMATION_SCHEMA.ROUTINES R join INFORMATION_SCHEMA.ROUTINE_PRIVILEGES RP
on (R.ROUTINE_SCHEMA = RP.ROUTINE_SCHEMA
and R.ROUTINE_NAME = RP.ROUTINE_NAME
and R.SPECIFIC_SCHEMA = RP.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = RP.SPECIFIC_NAME)
where R.ROUTINE_SCHEMA  = '${object_schema}'
and   R.ROUTINE_NAME    = '${object_name}'
and   R.SPECIFIC_SCHEMA = '${object_schema}'
and   R.SPECIFIC_NAME   = '${specific_name}'
and   R.ROUTINE_TYPE    = '${object_type}'
and   PRIVILEGE_TYPE in ('${privilege_type}')
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIdentObjectPrivileges">
         <SQL>
            <![CDATA[
select OBJECT_SCHEMA,OBJECT_NAME,OBJECT_TYPE,PRIVILEGE_TYPE,GRANTOR,IS_GRANTABLE,GRANTEE
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where GRANTEE = '${grantee}'
and PRIVILEGE_TYPE in ('${privilege_type}')
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTablePrivileges">
         <SQL>
            <![CDATA[
select TABLE_SCHEMA,TABLE_NAME,PRIVILEGE_TYPE,GRANTOR,IS_GRANTABLE,GRANTEE
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where GRANTEE = '${grantee}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getColumnPrivileges">
         <SQL>
            <![CDATA[
select GRANTOR,GRANTEE,TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE,IS_GRANTABLE
from INFORMATION_SCHEMA.COLUMN_PRIVILEGES
where GRANTEE = '${grantee}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableColumnPrivileges">
         <SQL>
            <![CDATA[
select GRANTOR,GRANTEE,TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE,IS_GRANTABLE
from INFORMATION_SCHEMA.COLUMN_PRIVILEGES
where TABLE_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and COLUMN_NAME = '${column_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getColumnUsed">
         <SQL>
            <![CDATA[
select RCU.ROUTINE_SCHEMA as USING_OBJECT_SCHEMA,RCU.ROUTINE_NAME as USING_OBJECT_NAME,R.ROUTINE_TYPE as USING_OBJECT_TYPE
from INFORMATION_SCHEMA.ROUTINE_COLUMN_USAGE RCU join INFORMATION_SCHEMA.ROUTINES R
on (RCU.SPECIFIC_SCHEMA = R.SPECIFIC_SCHEMA and
    RCU.SPECIFIC_NAME = R.SPECIFIC_NAME and
    RCU.ROUTINE_SCHEMA = R.ROUTINE_SCHEMA and
    RCU.ROUTINE_NAME = R.ROUTINE_NAME)
where RCU.TABLE_SCHEMA = '${table_schema}'
and RCU.TABLE_NAME = '${table_name}'
and RCU.COLUMN_NAME = '${column_name}'
union
select VIEW_SCHEMA,VIEW_NAME,'VIEW'
from INFORMATION_SCHEMA.VIEW_COLUMN_USAGE VCU
where VCU.TABLE_SCHEMA = '${table_schema}'
and VCU.TABLE_NAME = '${table_name}'
and VCU.COLUMN_NAME = '${column_name}'
union
select TRIGGER_SCHEMA,TRIGGER_NAME,'TRIGGER'
from INFORMATION_SCHEMA.TRIGGER_COLUMN_USAGE TCU
where TCU.TABLE_SCHEMA = '${table_schema}'
and TCU.TABLE_NAME = '${table_name}'
and TCU.COLUMN_NAME = '${column_name}'
union
select CONSTRAINT_SCHEMA,CONSTRAINT_NAME,'CONSTRAINT'
from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CCU
where CCU.TABLE_SCHEMA = '${table_schema}'
and CCU.TABLE_NAME = '${table_name}'
and CCU.COLUMN_NAME = '${column_name}'
union
select INDEX_SCHEMA,INDEX_NAME,'INDEX'
from INFORMATION_SCHEMA.EXT_INDEX_COLUMN_USAGE
where INDEX_SCHEMA = '${table_schema}'
and TABLE_NAME = '${table_name}'
and COLUMN_NAME = '${column_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getIdentSource">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select 'create ident ${ident} as ' || trim(trailing from IDENT_TYPE) ||
case when IDENT_TYPE in ('USER','PROGRAM') then cast(' using ''**********''' as varchar(20)) else '' end
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_NAME = '${ident}'
          ]]>
            </If>
            <Else>
              <If test="#util.isDatabaseVersionLTE(10,0)">
                <![CDATA[
select 'create ident "${ident}" as ' || IDENT_TYPE ||
case when IDENT_TYPE in ('USER','PROGRAM') then cast(' using ''**********''' as varchar(20)) else '' end ||
case when IDENT_TYPE <> 'GROUP' then case when IDENT_SCHEMA = 'YES' then ' with schema' else ' without schema' end else '' end
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_NAME = '${ident}'
          ]]>
              </If>
              <Else>
          <![CDATA[
select 'create ident "${ident}" as ' || IDENT_TYPE ||
case when IDENT_TYPE = 'PROGRAM' then cast(' using ''**********''' as varchar(20)) else '' end ||
case when IDENT_TYPE <> 'GROUP' then case when IDENT_SCHEMA = 'YES' then cast(' with schema' as varchar(12)) else ' without schema' end else '' end ||
case when IDENT_TYPE = 'USER' and HAS_PASSWORD = 'YES' then ';' || ASCII_CHAR(10) || 'alter ident "${ident}" set password ''**********'';' else '' end
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_NAME = '${ident}'
fetch 1
          ]]>
              </Else>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getDatabanks">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <![CDATA[
select DATABANK_CREATOR,DATABANK_NAME,DATABANK_TYPE,IS_ONLINE,FILE_NAME
from INFORMATION_SCHEMA.EXT_DATABANKS
            ]]>
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <![CDATA[
select DATABANK_CREATOR,DATABANK_NAME,DATABANK_TYPE,IS_ONLINE,FILE_NAME,MINSIZE,GOALSIZE,MAXSIZE,IS_REMOVABLE
from INFORMATION_SCHEMA.EXT_DATABANKS
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getDatabankFacts">
         <SQL>
            <![CDATA[
select DATABANK_NAME,CREATION_DATE,
case when CREATION_DATE <> ALTERATION_DATE then ALTERATION_DATE end as ALTERATION_DATE,REMARKS
from INFORMATION_SCHEMA.EXT_DATABANKS left outer join INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
on (OBJECT_SCHEMA is null and
    OBJECT_NAME = DATABANK_NAME and
    OBJECT_TYPE = 'DATABANK')
         ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDatabankInfo">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <!-- Version 9.2 or earlier -->
               <![CDATA[
select DATABANK_CREATOR,DATABANK_NAME,DATABANK_TYPE,IS_ONLINE,FILE_NAME
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${databank_name}'
               ]]>
            </If>
            <Else>
               <![CDATA[
select DATABANK_CREATOR,DATABANK_NAME,DATABANK_TYPE,IS_ONLINE,FILE_NAME,MINSIZE,GOALSIZE,MAXSIZE,IS_REMOVABLE,BACKUP_DATE
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${databank_name}'
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getObjectsInDatabank">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <!-- Version 9.2 or earlier -->
               <![CDATA[
select TABLE_SCHEMA,TABLE_NAME,DATABANK_NAME
from INFORMATION_SCHEMA.EXT_TABLE_DATABANK_USAGE
where DATABANK_NAME = '${databank_name}'
            ]]>
            </If>
            <Else>
               <![CDATA[
select 'TABLE' as OBJECT_TYPE,TABLE_SCHEMA as OBJECT_SCHEMA,TABLE_NAME as OBJECT_NAME,DATABANK_NAME
from INFORMATION_SCHEMA.EXT_TABLE_DATABANK_USAGE
where DATABANK_NAME = '${databank_name}'
union all
select USING_OBJECT_TYPE,USING_OBJECT_SCHEMA,USING_OBJECT_NAME,USED_OBJECT_NAME
from INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_TYPE = 'DATABANK'
and USED_OBJECT_NAME = '${databank_name}'
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getShadows">
         <SQL>
            <![CDATA[
select SHADOW_CREATOR,SHADOW_NAME,DATABANK_NAME,IS_ONLINE,FILE_NAME
from INFORMATION_SCHEMA.EXT_SHADOWS
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getShadowInfo">
         <SQL>
            <![CDATA[
select SHADOW_CREATOR,SHADOW_NAME,DATABANK_NAME,IS_ONLINE,FILE_NAME
from INFORMATION_SCHEMA.EXT_SHADOWS
where SHADOW_NAME = '${shadow_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getShadowSource">
         <SQL>
            <![CDATA[
select 'create shadow "${shadow_name}" for ' || DATABANK_NAME || ' in ''' || FILE_NAME || ''''
from INFORMATION_SCHEMA.EXT_SHADOWS
where SHADOW_NAME = '${shadow_name}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getShadowsForDatabank">
         <SQL>
            <![CDATA[
select SHADOW_CREATOR,SHADOW_NAME,DATABANK_NAME,IS_ONLINE,FILE_NAME
from INFORMATION_SCHEMA.EXT_SHADOWS where DATABANK_NAME = '${databank_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDatabankSource">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <!-- Version 9.2 or earlier -->
               <![CDATA[
select 'create databank ${databank_name} in ''' || FILE_NAME || ''' with ' || DATABANK_TYPE || ' option'
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${databank_name}'
               ]]>
            </If>
            <Else>
               <![CDATA[
select 'create databank "${databank_name}" set file ''' || FILE_NAME || ''', option ' || DATABANK_TYPE ||
case when GOALSIZE is not null then ', goalsize ' || cast(GOALSIZE as varchar(20)) || 'K' else '' end ||
case when MAXSIZE is not null then ', maxsize ' || cast(MAXSIZE as varchar(20)) || 'K' else '' end ||
case when IS_REMOVABLE = 'YES' then ', removable' else cast('' as varchar(1)) end
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${databank_name}'
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getDatabankFilename">
         <SQL>
            <![CDATA[
select FILE_NAME
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
         </SQL>
      </Command>

      <Command id="mimer.getDatabankForShadow">
         <SQL>
            <![CDATA[
select DATABANK_NAME
from INFORMATION_SCHEMA.EXT_SHADOWS
where SHADOW_NAME = '${objectname}'
                 ]]>
         </SQL>
      </Command>

      <Command id="mimer.getGrantees">
         <SQL>
            <If test="#util.isDatabaseVersionLTE(9,1)">
               <!-- Version 9.1 or earlier -->
               <![CDATA[
select distinct case when OBJECT_TYPE = 'SCHEMA' then OBJECT_NAME else OBJECT_SCHEMA end
from INFORMATION_SCHEMA.EXT_OBJECT_IDENT_USAGE
where OBJECT_SCHEMA is not null
and OBJECT_SCHEMA not in(CURRENT_USER,'INFORMATION_SCHEMA','MIMER','MIMER_UA','ODBC','FIPS_DOCUMENTATION','INFO_SCHEM')
and OBJECT_SCHEMA <> '${exclude_ident}'
union
select IDENT_NAME
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_NAME not in(CURRENT_USER,'MIMER_DD','MIMER_UA')
and IDENT_NAME <> '${exclude_ident}'
union
select 'PUBLIC'
from INFORMATION_SCHEMA.EXT_ONEROW
           ]]>
            </If>
            <Else>
               <![CDATA[
select E.SCHEMA_NAME
from INFORMATION_SCHEMA.EXT_SCHEMAS E
where E.SCHEMA_NAME not in(CURRENT_USER,'INFORMATION_SCHEMA','MIMER','MIMER_UA','ODBC','FIPS_DOCUMENTATION','INFO_SCHEM')
and E.SCHEMA_NAME <> '${exclude_ident}'
and E.SCHEMA_NAME not in (select SCHEMA_NAME from INFORMATION_SCHEMA.SCHEMATA S where S.SCHEMA_NAME = E.SCHEMA_NAME and S.SCHEMA_NAME <> S.SCHEMA_OWNER)
union
select IDENT_NAME
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_TYPE = 'GROUP'
and IDENT_NAME <> '${exclude_ident}'
union
select 'PUBLIC'
from INFORMATION_SCHEMA.EXT_ONEROW
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="mimer.getCurrentGroups">
         <SQL>
            <![CDATA[
select GRANTEE,OBJECT_NAME as GROUP_NAME
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where GRANTEE = CURRENT_USER
and PRIVILEGE_TYPE = 'MEMBER'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getSubscriptions">
         <SQL>
            <![CDATA[
select "SUBSCRIPTION_NAME", "TARGET_DATABASE" from repadm.rep_subscriptions
]]>
         </SQL>
      </Command>

      <Command id="mimer.getSubscriptionInfo">
         <SQL>
            <![CDATA[
select "SUBSCRIPTION_NAME", "TARGET_DATABASE", "WAKE_INTERVAL", "COMMIT_AFTER", "LAST_SYSTEM_STARTUP", 
       "LAST_TRANSNO", "LAST_SEQNO", "STOPPING_FLAG", "STATUS", "CREATED", "LAST_ALTERED" 
from repadm.rep_subscriptions where subscription_name = '${objectname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getTableSubscriptions">
         <SQL>
            <![CDATA[
select "SUBSCRIPTION_NAME", "SOURCE_SCHEMA", "SOURCE_TABLE", "TARGET_SCHEMA", "TARGET_TABLE", "CREATED"
from   repadm.rep_subscription_tables st
where  source_schema = '${source_schema}'
and    source_table = '${source_table}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getUserDefinedTypes">
         <SQL>
            <![CDATA[
select USER_DEFINED_TYPE_SCHEMA,USER_DEFINED_TYPE_NAME,USER_DEFINED_TYPE_CATEGORY,
       IS_INSTANTIABLE,IS_FINAL,
DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end as DATA_TYPE,
       COLLATION_SCHEMA,COLLATION_NAME
from INFORMATION_SCHEMA.USER_DEFINED_TYPES
where USER_DEFINED_TYPE_SCHEMA = '${schema}'
and USER_DEFINED_TYPE_CATEGORY like '${userDefinedTypeCategory}'
and USER_DEFINED_TYPE_NAME like '${userDefinedTypePattern}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getUDTAttributes">
         <SQL>
            <![CDATA[
select UDT_SCHEMA,UDT_NAME,ATTRIBUTE_NAME,ORDINAL_POSITION,IS_NULLABLE,
case when DATA_TYPE = 'USER-DEFINED' then
     case when ATTRIBUTE_UDT_SCHEMA = CURRENT_USER then '' else ATTRIBUTE_UDT_SCHEMA || '.' end ||
     ATTRIBUTE_UDT_NAME
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end as DATA_TYPE,
ATTRIBUTE_DEFAULT,COLLATION_SCHEMA,COLLATION_NAME
from INFORMATION_SCHEMA.ATTRIBUTES
where UDT_SCHEMA = '${schema}'
and UDT_NAME like '${udtname}'
and ATTRIBUTE_NAME like '${attributeLikePattern}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getAttributeSource">
         <SQL>
            <![CDATA[
select 'alter type "${schema}"."${udtname}"' || ASCII_CHAR(10) || 
'add attribute "' || ATTRIBUTE_NAME || '" ' || 
case when DATA_TYPE = 'USER-DEFINED' then
     case when ATTRIBUTE_UDT_SCHEMA = CURRENT_USER then '' else ATTRIBUTE_UDT_SCHEMA || '.' end ||
     ATTRIBUTE_UDT_NAME
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end
from INFORMATION_SCHEMA.ATTRIBUTES
where UDT_SCHEMA = '${schema}'
and UDT_NAME = '${udtname}'
and ATTRIBUTE_NAME = '${objectname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getMethodInfo">
         <SQL>
            <![CDATA[
select SPECIFIC_SCHEMA,SPECIFIC_NAME,UDT_SCHEMA,UDT_NAME,METHOD_NAME,
IS_STATIC,IS_OVERRIDING,IS_CONSTRUCTOR,
case when DATA_TYPE = 'USER-DEFINED' then
     case when RETURN_UDT_SCHEMA = CURRENT_USER then '' else RETURN_UDT_SCHEMA || '.' end ||
     RETURN_UDT_NAME
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end as DATA_TYPE,
COLLATION_SCHEMA,COLLATION_NAME,
METHOD_LANGUAGE,IS_DETERMINISTIC,SQL_DATA_ACCESS,CREATED,LAST_ALTERED
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS
where UDT_SCHEMA = '${schema}'
and METHOD_NAME like '${objectname}'
and SPECIFIC_NAME = '${specificname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getMethodParameters">
         <SQL>
            <![CDATA[
select SPECIFIC_SCHEMA,SPECIFIC_NAME,ORDINAL_POSITION,PARAMETER_MODE,
       IS_RESULT,PARAMETER_NAME,
case when DATA_TYPE = 'USER-DEFINED' then
     case when PARAMETER_UDT_SCHEMA = CURRENT_USER then '' else PARAMETER_UDT_SCHEMA || '.' end ||
     PARAMETER_UDT_NAME
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end as DATA_TYPE,
COLLATION_SCHEMA,COLLATION_NAME
from INFORMATION_SCHEMA.METHOD_SPECIFICATION_PARAMETERS
where SPECIFIC_SCHEMA = '${schema}'
and SPECIFIC_NAME = '${specificname}'
order by ORDINAL_POSITION
               ]]>
         </SQL>
      </Command>

      <Command id="mimer.getMethodResult">
         <SQL>
            <![CDATA[
select UDT_SCHEMA,UDT_NAME,
case when DATA_TYPE = 'USER-DEFINED' then
     case when RETURN_UDT_SCHEMA = CURRENT_USER then '' else RETURN_UDT_SCHEMA || '.' end ||
     RETURN_UDT_NAME
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end as DATA_TYPE,
COLLATION_SCHEMA,COLLATION_NAME
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS
where UDT_SCHEMA = '${schema}'
and METHOD_NAME like '${objectname}'
and SPECIFIC_NAME = '${specificname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getSpecificationSource">
         <SQL>
            <![CDATA[
select 'alter type "${schema}"."${udtname}" add ' || lower('${routinetype} "') || 
METHOD_NAME || '"(' || ascii_char(10)
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS
where UDT_SCHEMA = '${schema}'
and METHOD_NAME like '${objectname}'
and SPECIFIC_NAME = '${specificname}'
union all
select case when ORDINAL_POSITION = 1 then '     "' else '   , "' end  || PARAMETER_NAME || '" ' ||
case when DATA_TYPE = 'USER-DEFINED' then
     '"' || PARAMETER_UDT_SCHEMA || '"."' || PARAMETER_UDT_NAME || '"'
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end || coalesce('collate "' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"','')  || ascii_char(10)
from INFORMATION_SCHEMA.METHOD_SPECIFICATION_PARAMETERS
where SPECIFIC_SCHEMA = '${schema}'
and SPECIFIC_NAME = '${specificname}'
union all
select ')' || ascii_char(10) || 'returns ' ||
case when DATA_TYPE = 'USER-DEFINED' then
     '"' || RETURN_UDT_SCHEMA || '"."' || RETURN_UDT_NAME || '"'
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end || coalesce('collate "' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"','')  || ascii_char(10) ||
'specific "' || SPECIFIC_NAME || '" ' ||
case when IS_DETERMINISTIC = 'NO' then cast('NOT ' as varchar(4)) else '' end || 'DETERMINISTIC ' || SQL_DATA_ACCESS
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS
where UDT_SCHEMA = '${schema}'
and METHOD_NAME like '${objectname}'
and SPECIFIC_NAME = '${specificname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getUDTPrivileges">
         <SQL>
            <![CDATA[
select GRANTOR,GRANTEE,UDT_SCHEMA,UDT_NAME,PRIVILEGE_TYPE,IS_GRANTABLE
from   INFORMATION_SCHEMA.UDT_PRIVILEGES
where UDT_SCHEMA = '${schema}'
and UDT_NAME like '${objectname}'
]]>
         </SQL>
      </Command>

      <Command id="mimer.getUDTUsed">
         <SQL>
            <![CDATA[
select USING_OBJECT_SCHEMA,USING_OBJECT_NAME,null as COLUMN_NAME,USING_OBJECT_TYPE
from  INFORMATION_SCHEMA.EXT_OBJECT_OBJECT_USED
where USED_OBJECT_SCHEMA = '${schema}'
and   USED_OBJECT_NAME   = '${objectname}'
and   USED_OBJECT_TYPE   = 'USER DEFINED TYPE'
union all
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,'COLUMN'
from   INFORMATION_SCHEMA.COLUMN_UDT_USAGE
where UDT_SCHEMA = '${schema}'
and   UDT_NAME = '${objectname}'
order by USING_OBJECT_SCHEMA,USING_OBJECT_NAME
]]>
         </SQL>
      </Command>

      <Command id="mimer.getUDTSource">
         <SQL>
            <![CDATA[
select 'create type "' ||
case when USER_DEFINED_TYPE_SCHEMA = CURRENT_USER then '' else USER_DEFINED_TYPE_SCHEMA || '"."' end ||
USER_DEFINED_TYPE_NAME || '" as ' || 
case when USER_DEFINED_TYPE_CATEGORY = 'DISTINCT' 
then DATA_TYPE ||
     case DATA_TYPE
     when 'DOUBLE PRECISION' then ''
     when 'REAL' then ''
     when 'FLOAT' then ''
     when 'INTEGER' then ''
     when 'SMALLINT' then ''
     when 'BIGINT' then ''
     when 'DATE' then ''
     when 'INTERVAL'
     then case INTERVAL_TYPE
          when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
          when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
          when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
          end
     when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
          else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
          end
     end
else '(' 
end collate SQL_IDENTIFIER
from INFORMATION_SCHEMA.USER_DEFINED_TYPES
where USER_DEFINED_TYPE_SCHEMA = '${schema}'
and   USER_DEFINED_TYPE_NAME = '${objectname}'
union all
select case when ORDINAL_POSITION > 1 then cast(',' || ascii_char(10) || ' "' as varchar(5)) else '"' end || ATTRIBUTE_NAME || '" ' ||
case when DATA_TYPE = 'USER-DEFINED' then
     case when ATTRIBUTE_UDT_SCHEMA = CURRENT_USER then '"' else '"' || ATTRIBUTE_UDT_SCHEMA || '"."' end ||
     ATTRIBUTE_UDT_NAME || '"'
else DATA_TYPE collate SQL_IDENTIFIER ||
     case DATA_TYPE
     when 'DOUBLE PRECISION' then ''
     when 'REAL' then ''
     when 'FLOAT' then ''
     when 'INTEGER' then ''
     when 'SMALLINT' then ''
     when 'BIGINT' then ''
     when 'DATE' then ''
     when 'INTERVAL'
     then case INTERVAL_TYPE
          when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
          when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
          when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
          when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
          else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
          end
     when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
     else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
          else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
          end
     end
end
from INFORMATION_SCHEMA.ATTRIBUTES
where UDT_SCHEMA = '${schema}'
and   UDT_NAME = '${objectname}'
union all
select ')'
from INFORMATION_SCHEMA.USER_DEFINED_TYPES
where USER_DEFINED_TYPE_SCHEMA = '${schema}'
and   USER_DEFINED_TYPE_NAME = '${objectname}'
and USER_DEFINED_TYPE_CATEGORY = 'STRUCTURED';
]]>
         </SQL>
      </Command>

      <!-- ======================================== -->
      <!-- SQL standard conformance and sizing info -->
      <!-- ======================================== -->

      <Command id="mimer.getSqlStandards">
         <SQL>
            <![CDATA[
select 'SQL 1999 and 2003' as SQL_STANDARD from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'SQL 1992' from INFORMATION_SCHEMA.EXT_ONEROW
            ]]>
         </SQL>
      </Command>

      <Command id="mimer.getSqlStandard">
         <SQL>
            <![CDATA[
select * from ${table}
            ]]>
         </SQL>
      </Command>

   </Commands>

   <!-- =================================================================== -->
   <!-- Definition of the object actions that are used by the tree and views -->
   <!-- =================================================================== -->

   <ObjectsActionDef extends="false">

      <ActionGroup type="Schemas">
         <Action id="mimer-schema-create" label="Create Schema" reload="true"
                 resetschemas="true" icon="add">
            <Input label="Schema" name="schema" style="text"/>
            <Command>
               <SQL><![CDATA[create schema "${schema}"]]></SQL>
            </Command>
            <Result>
               <![CDATA[Schema <b>${schema}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Schema">
         <Action id="mimer-schema-comment" label="Comment Schema" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaRemark"/>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on schema "${schema}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for schema <b>${schema}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-schema-drop" label="Drop Schema" reload="true"
                 resetschemas="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop schema "${schema}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects in the schema including dependent objects that use the objects in the schema' : ''"/>
            <Confirm>
               <![CDATA[Really drop schema <b>${schema}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Schema <b>${schema}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>
         <Action id="mimer-schema-export" label="Export Schema"
                 icon="export" reload="false"
                 class="schemaExport"
                 doclink="http://www.dbvis.com/doclink/export-schema"/>
      </ActionGroup>

      <ActionGroup type="Tables">
         <If test="! #util.isLicensed()">
            <Action id="mimer-createsimpletable" label="Create Table" icon="add" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Table" name="tableName" style="text" editable="true"/>

               <Input label="Columns" style="separator"/>

               <Input name="columns" style="grid">
                  <Arg name="output" value='"${columnname}" ${dataType}${_collation}${_default}${_notNull}'/>
                  <Arg name="newline" value=", "/>

                  <Input label="Column name" name="columnname" style="text">
                     <Default>C1</Default>
                  </Input>

                  <Input label="Data Type" name="dataType" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDataTypeList"/>
                     </Values>
                     <Default>
                        CHARACTER VARYING(p)
                     </Default>
                  </Input>
                  <If test="#util.isDatabaseVersionLT(9)">
                     <SetVar name="_collation" value="''"/>
                  </If>
                  <Else>
                     <!-- Version 9.1 or later -->
                     <Input name="collation" label="Collation" style="list">
                        <Labels>
                           <Command idref="mimer.getCollationList"/>
                        </Labels>
                        <Values>
                           <Command idref="mimer.getCollationQuotedList"/>
                        </Values>
                     </Input>
                     <SetVar name="_collation" value='#collation.equals("") ? "" : " collate " + #collation'/>
                  </Else>
                  <Input label="Default" name="default" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDefaultList"/>
                     </Values>
                  </Input>
                  <SetVar name="_default" value="#default.equals('') ? '' : ' default ' + #default"/>
                  <Input label="Not NULL" name="notnull" style="text"/>
                  <SetVar name="_notNull" value='#notnull.equals("") ? "" : " constraint \"" + #notnull + "\" NOT NULL"'/>
               </Input>

               <Input label="Databank" name="databank" style="list">
                  <Labels>
                     <Command>
                        <SQL>
                           <![CDATA[
select '' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select OBJECT_NAME
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where GRANTEE = CURRENT_USER
and OBJECT_TYPE = 'DATABANK'
and PRIVILEGE_TYPE = 'TABLE'
]]>
                        </SQL>
                     </Command>
                  </Labels>
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[
select '' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '"' || OBJECT_NAME || '"'
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where GRANTEE = CURRENT_USER
and OBJECT_TYPE = 'DATABANK'
and PRIVILEGE_TYPE = 'TABLE'
]]>
                        </SQL>
                     </Command>
                  </Values>
               </Input>
               <SetVar name="_databank" value='#databank.equals("") ? "" : "\nin " + #databank'/>
               <Command>
                  <SQL>
                     <![CDATA[create table "${schema}"."${tableName}"(
${columns})${_databank}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Table <b>${schema}.${tableName}</b> with column <b>${columnName}</b> created.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <Action id="mimer-tables-create-table" label="Create Table"
                    icon="add" reload="true"
                    class="tableCreateOrAlter"
                    classargs="create"
                    doclink="http://www.dbvis.com/doclink/create-table"/>
            <Action id="mimer-tables-import-table-data" label="Import Table Data"
                    icon="import"
                    reload="true"
                    class="tableDataImport"
                    doclink="http://www.dbvis.com/doclink/import-table"/>
         </Else>
         <Action id="mimer-ident-statistics" label="Update Statistics" icon="UpdateStatistics">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[update statistics for ident "${schema}"]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Updating statistics may take some time if the tables are large. Continue anyway?]]>
            </Confirm>
            <Result>
               <![CDATA[Statistics for table owned by <b>${schema}</b> updated.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Table">
         <If test="! #util.isLicensed()">
         </If>
         <Else>
            <Action id="mimer-tables-alter-table" label="Alter Table"
                    icon="add" reload="true"
                    class="tableCreateOrAlter"
                    classargs="alter"
                    doclink="http://www.dbvis.com/doclink/alter-table"/>
         </Else>

         <If test="! #util.isLicensed()">
            <ActionGroup label="Alter Table">
               <Action id="mimer-altertable-addcheck" label="Add Check" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Table" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Constraint name" name="constraint" style="text"/>
                  <Input label="Check" name="check" style="text"/>
                  <SetVar name="_constraint" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\""'/>
                  <Command>
                     <SQL>
                        <![CDATA[alter table "${schema}"."${objectname}" 
add ${_constraint} 
check(${check})]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Constraint <b>${constraint}</b> added to table <b>${schema}.${objectname}</b>.]]>
                  </Result>
               </Action>

               <Action id="mimer-altertable-addcolumn" label="Add Column" icon="AddColumn" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Table" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Column" name="columnName" style="text"/>
                  <Input label="Data Type" name="dataType" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDataTypeList"/>
                     </Values>
                  </Input>
                  <If test="#util.isDatabaseVersionLT(9)">
                     <SetVar name="_collation" value="''"/>
                  </If>
                  <Else>
                     <!-- Version 9.1 or later -->
                     <Input label="Collation" name="collateClause" style="list">
                        <Labels>
                           <Command idref="mimer.getCollationList"/>
                        </Labels>
                        <Values>
                           <Command idref="mimer.getCollationQuotedList"/>
                        </Values>
                        <Default>{0}</Default>
                     </Input>
                     <SetVar name="_collation" value='#collateClause.equals("") ? "" : "\ncollate " + #collateClause'/>
                  </Else>
                  <Input label="Default" name="default" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDefaultList"/>
                     </Values>
                  </Input>
                  <Input label="Not NULL" name="notnull" style="check" linebreak="false">
                     <Values>NOT NULL</Values>
                  </Input>
                  <Input label="Constraint" name="constraint1" style="text" linebreak="true"/>
                  <SetVar name="_default" value="#default.equals('') ? '' : '\ndefault ' + #default"/>
                  <SetVar name="_notNullConstraint" value='#constraint1.equals("") ? "" : "\nconstraint \"" + #constraint1 + "\" "'/>
                  <SetVar name="_notNull" value='#notnull.equals("") ? "" : #_notNullConstraint + " " + #notnull'/>
                  <Command>
                     <SQL>
                        <![CDATA[alter table "${schema}"."${objectname}" 
add column "${columnName}" ${dataType}${_collation}${_default}${_notNull}]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Column <b>${columnName}</b> added to table  <b>${schema}.${objectname}</b>.]]>
                  </Result>
               </Action>

               <Action id="mimer-altertable-addforeignkey" label="Add Foreign Key" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Table" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Constraint name" name="constraint" style="text"/>

                  <Input label="Columns" style="separator"/>
                  <Input name="columnList" style="grid">
                     <Arg name="output" value='"${columnname}"'/>
                     <Arg name="newline" value=", "/>
                     <Input label="Column name" name="columnname" style="list">
                        <Values column="4">
                           <Command idref="getColumnNamesFor">
                              <Input name="table_catalog" value="${catalog}"/>
                              <Input name="table_schema" value="${schema}"/>
                              <Input name="table_name" value="${objectname}"/>
                           </Command>
                        </Values>
                        <Default>${0}</Default>
                     </Input>
                  </Input>

                  <Input label="Referenced table" name="refTable" style="list">
                     <Labels>
                        <Command>
                           <SQL>
                              <![CDATA[
select distinct TABLE_SCHEMA || '.' || TABLE_NAME
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where PRIVILEGE_TYPE = 'REFERENCES'
                 ]]>
                           </SQL>
                        </Command>
                     </Labels>
                     <Values>
                        <Command>
                           <SQL>
                              <![CDATA[
select distinct '"' || TABLE_SCHEMA || '"."' || TABLE_NAME || '"'
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where PRIVILEGE_TYPE = 'REFERENCES'
                 ]]>
                           </SQL>
                        </Command>
                     </Values>
                     <Default>{0}</Default>
                  </Input>
                  <SetVar name="_constraint" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\""'/>
                  <Command>
                     <SQL>
                        <![CDATA[alter table "${schema}"."${objectname}" 
add ${_constraint} 
foreign key(${columnList}) 
references ${refTable}]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Foreign key constraint <b>${constraint}</b> added to table  <b>${schema}.${objectname}</b>.]]>
                  </Result>
               </Action>

               <Action id="mimer-altertable-addkey" label="Add Primary/Unique Key" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Table" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Constraint name" name="constraint" style="text"/>
                  <Input label="Key Type" name="keyType" style="list">
                     <Labels>PRIMARY KEY|UNIQUE</Labels>
                     <Values>primary key|unique</Values>
                     <Default>PRIMARY KEY</Default>
                  </Input>
                  <Input label="Columns" style="separator"/>
                  <Input name="columnList" style="grid">
                     <Arg name="output" value='"${columnname}"'/>
                     <Arg name="newline" value=", "/>
                     <Input label="Column name" name="columnname" style="list">
                        <Values column="4">
                           <Command idref="getColumnNamesFor">
                              <Input name="table_catalog" value="${catalog}"/>
                              <Input name="table_schema" value="${schema}"/>
                              <Input name="table_name" value="${objectname}"/>
                           </Command>
                        </Values>
                        <Default>${0}</Default>
                     </Input>
                  </Input>
                  <SetVar name="_constraint" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\""'/>
                  <Command>
                     <SQL>
                        <![CDATA[alter table "${schema}"."${objectname}" 
add ${_constraint} 
${keyType}(${columnList})]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[<b>${keyType}</b> constraint <b>${constraint}</b> added to table <b>${schema}.${objectname}</b>.]]>
                  </Result>
               </Action>

               <Separator/>

               <Action id="mimer-altertable-dropcolumn" label="Drop Column" icon="removeColumn" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Table" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Column" name="column" style="list">
                     <Values>
                        <Command>
                           <SQL>
                              <![CDATA[
select COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${objectname}'
                 ]]>
                           </SQL>
                        </Command>
                     </Values>
                     <Default>{0}</Default>
                  </Input>
                  <Input label="Drop Option" name="option" style="radio">
                     <Labels>RESTRICT|CASCADE</Labels>
                     <Values>restrict|cascade</Values>
                     <Default>RESTRICT</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[alter table "${schema}"."${objectname}" drop "${column}" ${option}]]></SQL>
                  </Command>
                  <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the column, such as views and procedures' : ''"/>
                  <Confirm>
                     <![CDATA[Really drop column <b>${column}</b> from table <b>${schema}.${objectname}</b>${_cascadeText}?]]>
                  </Confirm>
                  <Result>
                     <![CDATA[Column <b>${column}</b> dropped from table <b>${schema}.${objectname}</b> with <b>${option}</b> option.]]>
                  </Result>
               </Action>

               <Action id="mimer-altertable-dropconstraint" label="Drop Constraint" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Table" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Constraint" name="constraint" style="list">
                     <Values>
                        <Command>
                           <SQL>
                              <![CDATA[
select CONSTRAINT_NAME
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${objectname}'
                 ]]>
                           </SQL>
                        </Command>
                     </Values>
                     <Default>{0}</Default>
                  </Input>
                  <Input label="Drop Option" name="option" style="radio">
                     <Labels>RESTRICT|CASCADE</Labels>
                     <Values>restrict|cascade</Values>
                     <Default>RESTRICT</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[
alter table "${schema}"."${objectname}" 
drop constraint "${constraint}" ${option}
]]>
                     </SQL>
                  </Command>
                  <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and dependent constraints (when a foreign key or primary/unique key is dropped)' : ''"/>
                  <Confirm>
                     <![CDATA[Really drop constraint <b>${constraint}</b> from table <b>${schema}.${objectname}</b>${_cascadeText}?]]>
                  </Confirm>
                  <Result>
                     <![CDATA[Constraint <b>${constraint}</b> dropped from table <b>${schema}.${objectname}</b> with <b>${option}</b> option.]]>
                  </Result>
               </Action>
            </ActionGroup>
         </If>
         <Action id="mimer-table-comment" label="Comment Table" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="BASE TABLE"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on table "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for table <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-table-create-index" label="Create Index" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Index Name" name="indexname" style="text"/>
            <Input label="Unique" name="unique" style="check">
               <Values>unique</Values>
            </Input>

            <Input label="Columns" style="separator"/>

            <Input name="columns" style="grid">
               <Arg name="output" value='"${columnname}"${_collation}${_for}${_sortorder}'/>
               <Arg name="newline" value=", "/>

               <Input name="columnname" label="Column Name" style="list">
                  <Values column="4">
                     <Command idref="getColumnNamesFor">
                        <Input name="table_catalog" value="${catalog}"/>
                        <Input name="table_schema" value="${schema}"/>
                        <Input name="table_name" value="${objectname}"/>
                     </Command>
                  </Values>
                  <Default>${0}</Default>
               </Input>
               <Input name="collation" label="Collation" style="list">
                  <Labels>
                     <Command idref="mimer.getCollationList"/>
                  </Labels>
                  <Values>
                     <Command idref="mimer.getCollationQuotedList"/>
                  </Values>
               </Input>
               <Input name="algorithm" label="Algorithm" style="list">
                  <Values>PINYIN_START|PINYIN_WORD_START|SIMPLE|WORD_SEARCH
                  </Values>
                  <Default>SIMPLE</Default>
               </Input>
               <Input name="sortorder" label="Sort Order" style="radio">
                  <Labels>ASC|DESC</Labels>
                  <Values>ASC|DESC</Values>
                  <Default>ASC</Default>
               </Input>
               <SetVar name="_collation" value='#collation.equals("") ? "" : " collate " + #collation'/>
               <SetVar name="_sortorder" value='#sortorder.equals("") ? "" : " " + #sortorder'/>
               <SetVar name="_for" value='#algorithm.trim().equals("SIMPLE") ? "" : " for " + #algorithm'/>
            </Input>

            <SetVar name="_unique" value='#unique.equals("") ? "" : " " + #unique'/>
            <SetVar name="_columns" value='#columns.trim().equals("") ? "" : "(" + #columns + ")"'/>
            <SetVar name="_indexname" value='#indexname.trim().equals("") ? "" : " \"" + #schema + "\".\"" + #indexname + "\""'/>

            <Command>
               <SQL>
                  <![CDATA[create${_unique} index${_indexname} 
on "${schema}"."${objectname}" ${_columns}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Create index "${indexname}"?]]>
            </Confirm>
            <Result>
               <![CDATA[Index "${indexname}" created!]]>
            </Result>
         </Action>

         <Action id="mimer-tabletrigger-create" label="Create Trigger" icon="add" reload="true"
                 doclink="http://www.dbvis.com/doclink/create-trigger">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Time" name="triggerTime" style="radio">
               <Values>BEFORE|AFTER</Values>
               <Default>AFTER</Default>
            </Input>
            <Input label="Trigger Event" name="triggerEvent" style="radio">
               <Values>DELETE|INSERT|UPDATE</Values>
               <Default>INSERT</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own trigger code here
--
    declare P1 integer;
    set P1 = 10;
    if  P1 = 10 then
        signal sqlstate 'TA400';
    end if;]]>
               </Default>
            </Input>

            <SetVar name="_refd" value='#triggerEvent.equals("DELETE") ? "referencing old table as \"OLD_" + #objectname + "\"" : ""'/>
            <SetVar name="_refi" value='#triggerEvent.equals("INSERT") ? "referencing new table as \"NEW_" + #objectname + "\"" : ""'/>
            <SetVar name="_refu" value='#triggerEvent.equals("UPDATE") ? "referencing old table as \"OLD_" + #objectname + "\" new table as \"NEW_" + #objectname + "\"" : ""'/>

            <SetVar name="_ref1" value="#_refi.equals('') ? #_refd : #_refi"/>
            <SetVar name="_ref2" value="#_refu.equals('') ? #_ref1 : #_refu"/>

            <SetVar name="_references" value="#triggerTime.equals('BEFORE') ? '' : '\n' + #_ref2"/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
create trigger "${schema}"."${triggerName}" 
${triggerTime} ${triggerEvent} 
on "${schema}"."${objectname}"${_references} 
for each statement 
begin atomic 
${source}
end]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>

         <Action id="mimer-table-drop" label="Drop Table" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop table "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the table, such as views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop table <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Table <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>


         <Action id="mimer-table-dropindex" label="Drop Index" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Index" name="index" style="list">
               <Values>
                  <Command idref="mimer.getIndexList"/>
               </Values>
            </Input>
            <Command>
               <SQL><![CDATA[drop index "${index}"]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Really drop index <b>${schema}.${index}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Index ${name} for table <b>${schema}.${objectname}</b> dropped.]]>
            </Result>
         </Action>

         <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
            <Action id="mimer-table-clear" label="Empty Table" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Table" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL><![CDATA[delete from "${schema}"."${objectname}"]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really delete all rows in table <b>${schema}.${objectname}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[All rows in table <b>${schema}.${objectname}</b> deleted.]]>
                  All rows in table ${schema}.${objectname} deleted.
               </Result>
            </Action>
         </If>

         <Action id="mimer-table-grant" label="Grant Access" icon="grant" reload="true">
            <Input label="Access Privilege" name="access" style="list">
               <Values>ALL PRIVILEGES|DELETE|INSERT|REFERENCES|SELECT|UPDATE
               </Values>
               <Default>SELECT</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${access} 
on table "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[<b>${access}</b> on <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-table-import-table-data" label="Import Table Data" icon="import"
                 class="tableDataImport"
                 doclink="http://www.dbvis.com/doclink/import-table"/>

         <Action id="mimer-table-export" label="Export Table" icon="export"
                 class="tableExport"/>

         <Action id="mimer-table-revoke" label="Revoke Access" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Access Privilege" name="access" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct PRIVILEGE_TYPE
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where TABLE_SCHEMA = '${schema}'
and   TABLE_NAME = '${objectname}'
and   GRANTOR = CURRENT_USER
union
select 'ALL'
from INFORMATION_SCHEMA.EXT_ONEROW
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct GRANTEE
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where TABLE_SCHEMA =  '${schema}'
and   TABLE_NAME =    '${objectname}'
and   GRANTOR = CURRENT_USER
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} ${access} 
on "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as views' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <SetVar name="_s" value="#access.equals('ALL') ? 's' : ''"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${access}</b> privilege${_s} on table <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[<b>${_grantOptionText}</b><b>${access}</b> privilege${_s} on table <b>${schema}.${objectname}</b> revoked from <b>${ident}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-table-statistics" label="Update Statistics" icon="UpdateStatistics">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[update statistics for table "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Updating statistics may take some time if the table is large.
               Continue anyway?
            </Confirm>
            <Result>
               <![CDATA[Statistics for table <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Separator/>

         <Action id="mimer-table-script" label="Script Table" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"/>
      </ActionGroup>

      <ActionGroup label="Columns">
         <Action id="mimer-columns-add" label="Add Column To Table" icon="AddColumn" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Column" name="columnName" style="text"/>
            <Input label="Data Type" name="dataType" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDataTypeList"/>
               </Values>
            </Input>
            <If test="#util.isDatabaseVersionLT(9)">
               <SetVar name="_collation" value="''"/>
            </If>
            <Else>
               <!-- Version 9.1 or later -->
               <Input label="Collation" name="collateClause" style="list">
                  <Labels>
                     <Command idref="mimer.getCollationList"/>
                  </Labels>
                  <Values>
                     <Command idref="mimer.getCollationQuotedList"/>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <SetVar name="_collation" value='#collateClause.equals("") ? "" : "\ncollate " + #collateClause'/>
            </Else>
            <Input label="Default" name="default" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDefaultList"/>
               </Values>
            </Input>
            <Input label="Not NULL" name="notnull" style="check" linebreak="false">
               <Values>NOT NULL</Values>
            </Input>
            <Input label="Constraint" name="constraint1" style="text" linebreak="true"/>
            <SetVar name="_default" value="#default.equals('') ? '' : '\ndefault ' + #default"/>
            <SetVar name="_notNullConstraint" value='#constraint1.equals("") ? "" : "\nconstraint \"" + #constraint1 + "\" "'/>
            <SetVar name="_notNull" value='#notnull.equals("") ? "" : #_notNullConstraint + " " + #notnull'/>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${objectname}" 
add column "${columnName}" ${dataType}${_collation}${_default}${_notNull}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Column <b>${columnName}</b> added to table  <b>${schema}.${objectname}</b>.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Column">
         <ActionGroup label="Alter Column">
            <Action id="mimer-datatype-altercolumn" label="Data Type" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Table" style="text" editable="false">
                  <Default>${tablename}</Default>
               </Input>
               <Input label="Column" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Data type" editable="false" style="text">
                  <Default>
                     <Command idref="mimer.getColumnDataType"/>
                  </Default>
               </Input>
               <Input label="New Data type" name="datatype" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeList"/>
                  </Values>
               </Input>
               <If test="#util.isDatabaseVersionLT(9)">
                  <SetVar name="_collation" value="''"/>
               </If>
               <Else>
                  <!-- Version 9.1 or later -->
                  <Input label="Collation" name="collateClause" style="list">
                     <Labels>
                        <Command idref="mimer.getCollationList"/>
                     </Labels>
                     <Values>
                        <Command idref="mimer.getCollationQuotedList"/>
                     </Values>
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select
case when COLLATION_NAME is not null and (
          (COLLATION_SCHEMA <> 'INFORMATION_SCHEMA' or
           (COLLATION_NAME <> 'ISO8BIT' and COLLATION_NAME <> 'UCS_BASIC'))) then '"' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"'
else ''
end
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <SetVar name="_collation" value='#collateClause.equals("") ? "" : "\ncollate " + #collateClause'/>
               </Else>
               <Command>
                  <SQL>
                     <![CDATA[alter table "${schema}"."${tablename}" 
alter "${objectname}" ${datatype}${_collation}]]>
                  </SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really set data type for column <b>${schema}.${tablename}.${objectname}</b> to <b>${datatype}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[Data type for column <b>${schema}.${tablename}.${objectname}</b> set to <b>${datatype}</b>.]]>
               </Result>
            </Action>

            <Action id="mimer-dropdefault-altercolumn" label="Drop Default" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Table" style="text" editable="false">
                  <Default>${tablename}</Default>
               </Input>
               <Input label="Column" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Data type" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getColumnDataType"/>
                  </Default>
               </Input>
               <Input label="Default" name="default" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getColumnDefault"/>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter table "${schema}"."${tablename}" alter "${objectname}" 
drop default]]>
                  </SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really <b>drop default</b> value for column <b>${schema}.${tablename}.${objectname}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[Default value dropped for column <b>${schema}.${tablename}.${objectname}</b>.]]>
               </Result>
            </Action>

            <Action id="mimer-setdefault-altercolumn" label="Set Default" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Table" style="text" editable="false">
                  <Default>${tablename}</Default>
               </Input>
               <Input label="Column" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Data type" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getColumnDataType"/>
                  </Default>
               </Input>
               <Input label="Default" name="default" editable="true" style="list">
                  <!-- Check in 5.0.0.11 version -->
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[
select COLUMN_DEFAULT]]>
                           <If test="#util.isDatabaseVersionGTE(10)">
                              <![CDATA[ collate SQL_IDENTIFIER]]>
                           </If>
                           <![CDATA[ from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
union all
select '' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'next_value of "' || SEQUENCE_SCHEMA || '"."' || SEQUENCE_NAME || '"'
from INFORMATION_SCHEMA.EXT_SEQUENCES
]]>
                        </SQL>
                     </Command>
                  </Values>
                  <Default>
                     <Command idref="mimer.getColumnDefault"/>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter table "${schema}"."${tablename}" alter "${objectname}" 
set default ${default}]]>
                  </SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really set default value for column <b>${schema}.${tablename}.${objectname}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[Default value set for column <b>${schema}.${tablename}.${objectname}</b>.]]>
               </Result>
            </Action>
         </ActionGroup>

         <Action id="mimer-column-comment" label="Comment Column" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select REMARKS
from INFORMATION_SCHEMA.EXT_COLUMN_REMARKS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
                  ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on column "${schema}"."${tablename}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for column <b>${schema}.${tablename}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-column-createindex" label="Create Index" reload="true">
            <Input name="name" label="Name" style="text"/>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="sortorder" label="Sort Order" style="radio">
               <Labels>ASC|DESC</Labels>
               <Values>ASC|DESC</Values>
               <Default>ASC</Default>
            </Input>
            <If test="#util.isDatabaseVersionLT(9)">
               <SetVar name="_collation" value="''"/>
            </If>
            <Else>
               <!-- Version 9.1 or later -->
               <Input label="Collation" name="collateClause" style="list">
                  <Labels>
                     <Command idref="mimer.getCollationList"/>
                  </Labels>
                  <Values>
                     <Command idref="mimer.getCollationQuotedList"/>
                  </Values>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[
select
case when COLLATION_NAME is not null and (
          (COLLATION_SCHEMA <> 'INFORMATION_SCHEMA' or
           (COLLATION_NAME <> 'ISO8BIT' and COLLATION_NAME <> 'UCS_BASIC'))) then '"' || COLLATION_SCHEMA || '"."' || COLLATION_NAME || '"'
else ''
end
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
                    ]]>
                        </SQL>
                     </Command>
                  </Default>
               </Input>
               <SetVar name="_collation" value='#collateClause.equals("") ? "" : " collate " + #collateClause'/>
            </Else>
            <Command>
               <SQL>
                  <![CDATA[create index "${schema}"."${name}" on 
"${schema}"."${tablename}"("${objectname}"${_collation} ${sortorder})]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Really create index <b>${name}</b> on column <b>${schema}.${tablename}.${objectname}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Index <b>${name}</b> created on column <b>${schema}.${tablename}.${objectname}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-column-drop" label="Drop Column" icon="removeColumn" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${tablename}" drop "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the column, such as views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop column <b>${objectname}</b> from table <b>${schema}.${tablename}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Column <b>${objectname}</b> dropped from table <b>${schema}.${tablename}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-column-grant" label="Grant Column Access" icon="grant" reload="true">
            <Input label="Access Privilege" name="access" style="list">
               <Values>INSERT|REFERENCES|UPDATE</Values>
               <Default>UPDATE</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="withGrantOption" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${access}("${objectname}") 
on table "${schema}"."${tablename}" 
to "${grantee}" ${withGrantOption}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[<b>${access}</b> on <b>${schema}.${tablename}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-column-revoke" label="Revoke Column Access" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Access Privilege" name="access" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct PRIVILEGE_TYPE
from INFORMATION_SCHEMA.COLUMN_PRIVILEGES
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
and PRIVILEGE_TYPE <> 'SELECT'
and GRANTOR = CURRENT_USER
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct GRANTEE
from INFORMATION_SCHEMA.COLUMN_PRIVILEGES
where TABLE_SCHEMA = '${schema}'
and   TABLE_NAME = '${tablename}'
and   COLUMN_NAME = '${objectname}'
and   GRANTOR = CURRENT_USER
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} ${access}("${objectname}") 
on "${schema}"."${tablename}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${access}</b> privilege on column <b>${schema}.${tablename}(${objectname})</b> from <b>${ident}</b>${_cascade_text}?]]>
            </Confirm>
            <Result>
               <![CDATA[${_grantOptionText}<b>${access}</b> on column <b>${schema}.${tablename}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Constraints" label="Constraints">
         <Action id="mimer-constraints-addcheck" label="Add Check" icon="CheckMark" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Constraint name" name="constraint" style="text"/>
            <Input label="Check" name="check" style="text"/>
            <SetVar name="_constraint" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\""'/>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${objectname}" 
add ${_constraint} 
check(${check})]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Constraint <b>${constraint}</b> added to table <b>${schema}.${objectname}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-constraints-addforeignkey" label="Add Foreign Key" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Constraint name" name="constraint" style="text"/>

            <Input label="Columns" style="separator"/>
            <Input name="columnList" style="grid">
               <Arg name="output" value='"${columnname}"'/>
               <Arg name="newline" value=", "/>
               <Input label="Column name" name="columnname" style="list">
                  <Values column="4">
                     <Command idref="getColumnNamesFor">
                        <Input name="table_catalog" value="${catalog}"/>
                        <Input name="table_schema" value="${schema}"/>
                        <Input name="table_name" value="${objectname}"/>
                     </Command>
                  </Values>
                  <Default>${0}</Default>
               </Input>
            </Input>
            <Input label="Referenced table" name="refTable" style="list">
               <Labels>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct TABLE_SCHEMA || '.' || TABLE_NAME
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where PRIVILEGE_TYPE = 'REFERENCES'
                 ]]>
                     </SQL>
                  </Command>
               </Labels>
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct '"' || TABLE_SCHEMA || '"."' || TABLE_NAME || '"'
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where PRIVILEGE_TYPE = 'REFERENCES'
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <SetVar name="_constraint" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\""'/>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${objectname}" 
add ${_constraint} 
foreign key(${columnList}) 
references ${refTable}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Foreign key constraint <b>${constraint}</b> added to table  <b>${schema}.${objectname}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-constraints-addkey" label="Add Primary/Unique Key" icon="PrimaryKey" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Constraint name" name="constraint" style="text"/>
            <Input label="Key Type" name="keyType" style="list">
               <Labels>PRIMARY KEY|UNIQUE</Labels>
               <Values>primary key|unique</Values>
               <Default>PRIMARY KEY</Default>
            </Input>
            <Input label="Columns" style="separator"/>
            <Input name="columnList" style="grid">
               <Arg name="output" value='"${columnname}"'/>
               <Arg name="newline" value=", "/>
               <Input label="Column name" name="columnname" style="list">
                  <Values column="4">
                     <Command idref="getColumnNamesFor">
                        <Input name="table_catalog" value="${catalog}"/>
                        <Input name="table_schema" value="${schema}"/>
                        <Input name="table_name" value="${objectname}"/>
                     </Command>
                  </Values>
                  <Default>${0}</Default>
               </Input>
            </Input>
            <SetVar name="_constraint" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\""'/>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${objectname}" 
add ${_constraint} 
${keyType}(${columnList})]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[<b>${keyType}</b> constraint <b>${constraint}</b> added to table <b>${schema}.${objectname}</b>.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Constraint">
         <Action id="mimer-constraint-drop" label="Drop Constraint" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Constraint" name="constraint" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[
alter table "${schema}"."${tablename}" 
drop constraint "${objectname}" ${option}
]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and dependent constraints (when a foreign key or primary/unique key is dropped)' : ''"/>
            <Confirm>
               <![CDATA[Really drop constraint <b>${constraint}</b> from table <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Constraint <b>${constraint}</b> dropped from table <b>${schema}.${objectname}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

     <ActionGroup type="AccessPath">
       <Action id="mimer-accesspath-drop" label="Drop Access Path" icon="remove" reload="true">
         <Input label="Schema" style="text" editable="false">
           <Default>${schema}</Default>
         </Input>
         <Input label="Table Name" style="text" editable="false">
           <Default>${theTableName}</Default>
         </Input>
         <Input label="Access Path" style="text" editable="false">
           <Default>${objectname}</Default>
         </Input>
         <Input label="Type" name="accesstype" style="text" editable="false">
           <Default>${access_path_type}</Default>
         </Input>
         <Input label="Drop Option" name="option" style="radio" hideif="#dataMap.get('access_path_type').equals('INDEX')">
           <Labels>RESTRICT|CASCADE</Labels>
           <Values>restrict|cascade</Values>
           <Default>RESTRICT</Default>
         </Input>
         <SetVar name="_command" value='#accesstype.equals("INDEX") ? "drop index \"" + #schema + "\".\"" + #objectname + "\"" : "alter table \"" + #schema + "\".\"" + #theTableName + "\" drop constraint \"" + #objectname + "\" " + #option'/>
         <Command>
           <SQL>
             <![CDATA[${_command}]]>
           </SQL>
         </Command>
         <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and dependent constraints (when a foreign key or primary/unique key is dropped)' : ''"/>
         <Confirm>
           <![CDATA[Really drop constraint <b>${constraint}</b> from table <b>${schema}.${objectname}</b>${_cascadeText}?]]>
         </Confirm>
         <Result>
           <![CDATA[Constraint <b>${constraint}</b> dropped from table <b>${schema}.${objectname}</b> with <b>${option}</b> option.]]>
         </Result>
       </Action>
     </ActionGroup>

      <ActionGroup type="ViewColumn">
         <Action id="mimer-viewcolumn-comment" label="Comment Column" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select REMARKS
from INFORMATION_SCHEMA.EXT_COLUMN_REMARKS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
                  ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on column "${schema}"."${tablename}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for column <b>${schema}.${tablename}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-viewcolumn-grant" label="Grant Column Access" icon="grant" reload="true">
            <Input label="Access Privilege" name="access" style="list">
               <Values>INSERT|REFERENCES|UPDATE</Values>
               <Default>UPDATE</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${access}("${objectname}") 
on table "${schema}"."${tablename}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[<b>${access}</b> on <b>${schema}.${tablename}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-viewcolumn-revoke" label="Revoke Column Access" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Access Privilege" name="access" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct PRIVILEGE_TYPE
from INFORMATION_SCHEMA.COLUMN_PRIVILEGES
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${tablename}'
and COLUMN_NAME = '${objectname}'
and PRIVILEGE_TYPE <> 'SELECT'
and GRANTOR = CURRENT_USER
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${tablename}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct GRANTEE
from INFORMATION_SCHEMA.COLUMN_PRIVILEGES
where TABLE_SCHEMA = '${schema}'
and   TABLE_NAME = '${tablename}'
and   COLUMN_NAME = '${objectname}'
and   GRANTOR = CURRENT_USER
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} ${access}("${objectname}") 
on "${schema}"."${tablename}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as views' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${access}</b> privilege on column <b>${schema}.${tablename}(${objectname})</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[<b>${grantOption}</b> <b>${access}</b> on column <b>${schema}.${tablename}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Views">
         <Action id="mimer-create-views" label="Script: Create View" icon="add" resultaction="mergeasscript" resulttarget="editor">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" name="view" style="text"/>
            <Input label="Source Table" name="table" style="list">
               <Values>
                  <Command idref="mimer.getTableByType">
                     <Input name="table_type" value="'BASE TABLE','VIEW'"/>
                  </Command>
               </Values>
               <Default>${0}</Default>
            </Input>
            <Input label="Check option" name="checkoption" style="list">
               <Values>|WITH CHECK OPTION|WITH CASCADED CHECK OPTION</Values>
               <Default>${0}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[
select 'create view "${schema}"."${view}"("' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      ,"' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
union all
select '    ) as select "' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      ,"' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
union all
select '    from "${schema}"."${table}" ${checkoption}' from INFORMATION_SCHEMA.EXT_ONEROW
              ]]>
               </SQL>
            </Command>
            <!-- Result for source? -->
            <Result>
               <![CDATA[Source for view <b>${schema}.${view}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="View">
         <Action id="mimer-view-comment" label="Comment View" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="VIEW"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on view "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for view <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-viewtrigger-create" label="Create Trigger" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Event" name="triggerEvent" style="radio">
               <Values>DELETE|INSERT|UPDATE</Values>
               <Default>INSERT</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own trigger code here
--
    declare P1 integer;
    set P1 = 10;
    if  P1 = 10 then
        signal sqlstate 'TA400';
    end if;]]>
               </Default>
            </Input>

            <SetVar name="_refd" value='#triggerEvent.equals("DELETE") ? "referencing old table as \"OLD_" + #objectname + "\"" : ""'/>
            <SetVar name="_refi" value='#triggerEvent.equals("INSERT") ? "referencing new table as \"NEW_" + #objectname + "\"" : ""'/>
            <SetVar name="_refu" value='#triggerEvent.equals("UPDATE") ? "referencing old table as \"OLD_" + #objectname + "\" new table as \"NEW_" + #objectname + "\"" : ""'/>

            <SetVar name="_ref1" value="#_refi.equals('') ? #_refd : #_refi"/>
            <SetVar name="_ref2" value="#_refu.equals('') ? #_ref1 : #_refu"/>

            <SetVar name="_references" value="#_ref2.equals('') ? '' : '\n' + #_ref2"/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
create trigger "${schema}"."${triggerName}" 
instead of ${triggerEvent} 
on "${schema}"."${objectname}"${_references} 
for each statement 
begin atomic 
${source}
end]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger ${schema}.${triggerName} created.]]>
            </Result>
         </Action>

         <Action id="mimer-view-drop" label="Drop View" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop view "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the view, such as procedures and statements' : ''"/>
            <Confirm>
               <![CDATA[Really drop view <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[View <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-view-grant" label="Grant Access" icon="grant" reload="true">
            <Input label="Access Privilege" name="access" style="list">
               <Values>ALL PRIVILEGES|DELETE|INSERT|REFERENCES|SELECT|UPDATE
               </Values>
               <Default>SELECT</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${access} 
on "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[${access} on <b>${schema}.${objectname}</b> granted to ${grantee}.]]>
            </Result>
         </Action>

         <Action id="mimer-view-revoke" label="Revoke Access" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Access Privilege" name="access" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct PRIVILEGE_TYPE
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where TABLE_SCHEMA = '${schema}'
and   TABLE_NAME = '${objectname}'
and   GRANTOR = CURRENT_USER
union
select 'ALL'
from INFORMATION_SCHEMA.EXT_ONEROW
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select distinct GRANTEE
from INFORMATION_SCHEMA.TABLE_PRIVILEGES
where TABLE_SCHEMA =  '${schema}'
and   TABLE_NAME =    '${objectname}'
and   GRANTOR = CURRENT_USER
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} ${access} 
on "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as other views' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <SetVar name="_s" value="#access.equals('ALL') ? 's' : ''"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${access}</b> privilege${_s} on view <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[${grantOption} ${access} on view <b>${schema}.${objectname}</b> revoked from ${ident} with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-view-export" label="Export View" icon="export"
                 class="viewExport"
                 doclink="http://www.dbvis.com/doclink/export-view"/>

         <Separator/>

         <Action id="mimer-view-script" label="Script View" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"/>
      </ActionGroup>

      <ActionGroup type="Synonyms">
         <Action id="mimer-synonym-create" label="Create Synonym" reload="true" icon="add">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym" name="synonymName" style="text"/>
            <Input label="Object Name" name="objName" editable="false" style="list">
               <Labels>
                  <Command>
                     <SQL>
                        <![CDATA[
select T.TABLE_SCHEMA || '.' || T.TABLE_NAME as QUALIFIED_NAME
from INFORMATION_SCHEMA.TABLES T order by QUALIFIED_NAME
                 ]]>
                     </SQL>
                  </Command>
               </Labels>
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select '"' || T.TABLE_SCHEMA || '"."' || T.TABLE_NAME || '"' as QUALIFIED_NAME
from INFORMATION_SCHEMA.TABLES T order by QUALIFIED_NAME
                 ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[create synonym "${schema}"."${synonymName}" for ${objName}]]></SQL>
            </Command>
            <Result>
               <![CDATA[Synonym <b>${schema}.${synonymName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Synonym">
         <Action id="mimer-synonym-comment" label="Comment Synonym" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="SYNONYM"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on synonym "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for synonym <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-synonym-drop" label="Drop Synonym" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop synonym "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Really drop synonym <b>${schema}.${objectname}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Synonym <b>${schema}.${objectname}</b> dropped.]]>
            </Result>
         </Action>

         <Action id="mimer-script-createsynonym" label="Script: Create Synonym" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getSynonymSource">
               <Input name="synonym_schema" value="${schema}"/>
               <Input name="synonym_name" value="${objectname}"/>
            </Command>
         </Action>

      </ActionGroup>

      <ActionGroup type="Index">
         <Action id="mimer-index-comment" label="Comment Index" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="INDEX"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on index "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for index <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-index-drop" label="Drop Index" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop index "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Really drop index <b>${schema}.${objectname}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Index <b>${schema}.${objectname}</b> dropped.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Sequences">
         <Action id="mimer-sequence-create" label="Create Sequence" reload="true" icon="add">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" name="sequenceName" style="text"/>
             <If test="#util.isDatabaseVersionGTE(10,1)">
               <Input label="Data type" name="datatype" editable="false" style="list">
                  <Labels>SMALLINT|INTEGER|BIGINT</Labels>
                  <Values>SMALLINT|INTEGER|BIGINT</Values>
                  <Default>INTEGER</Default>
               </Input>
            </If>
            <Input label="Unique" name="unique" style="check">
               <Values>UNIQUE</Values>
            </Input>
            <Input label="Initial Value" name="initialValue" editable="true" style="list">
               <Values>1|-32768|-2147483648|-9223372036854775808</Values>
               <Default>1</Default>
            </Input>
            <Input label="Increment" name="increment" style="number">
               <Default>1</Default>
            </Input>
            <Input label="Max Value" name="maxValue" editable="true" style="list">
               <Values>32767|2147483647|9223372036854775807</Values>
               <Default/>
            </Input>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <SetVar name="databank" value="''"/>
            </If>
            <Else>
               <!-- Version 9.3 or later -->

               <Input label="Databank" name="databank" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[
select '' from INFORMATION_SCHEMA.EXT_ONEROW
union
select distinct OBJECT_NAME
from INFORMATION_SCHEMA.EXT_OBJECT_PRIVILEGES
where GRANTEE in (CURRENT_USER,'PUBLIC')
and OBJECT_TYPE = 'DATABANK'
and PRIVILEGE_TYPE = 'SEQUENCE'
]]>
                        </SQL>
                     </Command>
                  </Values>
               </Input>
            </Else>
             <If test="#util.isDatabaseVersionGTE(10,1)">
               <SetVar name="_datatype" value="' as ' + #datatype"/>
            </If>
            <Else>
               <SetVar name="_datatype" value="''"/>
            </Else>
            <SetVar name="_initialValue" value="#initialValue.equals('') ? '' : '\n   initial_value = ' + #initialValue"/>
            <SetVar name="_increment" value="#increment.equals('') ? '' : '\n   increment = ' + #increment"/>
            <SetVar name="_maxValue" value="#maxValue.equals('') ? '' : '\n   max_value = ' + #maxValue"/>
            <SetVar name="_databank" value="#databank.equals('') ? '' : '\n   in ' + #databank"/>
            <Command>
               <SQL>
                  <![CDATA[create ${unique} sequence "${schema}"."${sequenceName}"${_datatype}${_initialValue}${_increment}${_maxValue}${_databank}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Sequence <b>${schema}.${sequenceName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Sequence">
         <If test="#util.isDatabaseVersionLTE(9,1)">
         </If>
         <Else>
            <!-- Version 9.2 or later -->
            <Action id="mimer-sequence-alter" label="Alter Sequence">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Sequence" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Restart value" name="restartValue" style="number"/>
               <Command>
                  <SQL>
                     <![CDATA[alter sequence "${schema}"."${objectname}" restart with ${restartValue}]]></SQL>
               </Command>
               <Result>
                  <![CDATA[Sequence <b>${schema}.${objectname}</b> restarted at value ${restartValue}.]]>
               </Result>
            </Action>
         </Else>

         <Action id="mimer-sequence-comment" label="Comment Sequence" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="SEQUENCE"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on sequence "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for sequence <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-sequence-drop" label="Drop Sequence" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop sequence "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the sequence, such as column default values and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop sequence <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Sequence <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-sequence-grant" label="Grant Usage" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant usage 
on sequence "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Usage on sequence <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-sequence-revoke" label="Revoke Usage" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForSchemaObjectPrivileges">
                     <Input name="object_type" value="SEQUENCE"/>
                     <Input name="privilege_type" value="USAGE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} usage 
on sequence "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the sequence, such as column default values and procedures' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}usage privilege on sequence <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <SetVar name="_usage" value="#grantOption.equals('') ? 'Usage' : 'usage'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_usage} privilege on sequence <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-script-createsequence" label="Script: Create Sequence" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getSequenceSource">
               <Input name="sequence_schema" value="${schema}"/>
               <Input name="sequence_name" value="${objectname}"/>
            </Command>
         </Action>

      </ActionGroup>

      <ActionGroup type="Functions">
         <If test="#util.isDatabaseVersionLTE(9,2)">
            <!-- Version 9.2 or earlier -->
            <Action id="mimer-functions-create92" label="Create Function" reload="true" icon="add"
                    doclink="http://www.dbvis.com/doclink/create-function">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" name="functionName" style="text"/>
               <Input label="Return Data Type" name="returns" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
                  <Default>${defaultdatatype}</Default>
               </Input>
               <Input label="Deterministic" name="deterministic" style="radio">
                  <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
                  <Default>NOT DETERMINISTIC</Default>
               </Input>
               <Input label="Access Option" name="option" style="list">
                  <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
                  <Default>READS SQL DATA</Default>
               </Input>

               <Input label="Parameters" style="separator"/>

               <Input name="parameters" style="grid">
                  <Arg name="output" value='IN "${name}" ${type}'/>
                  <Arg name="newline" value=", "/>

                  <Input name="name" label="Name" style="text">
                     <Default>P1</Default>
                  </Input>
                  <Input name="type" label="Type" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDataTypeListByType">
                           <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                        </Command>
                     </Values>
                     <Default>${defaultdatatype}</Default>
                  </Input>
               </Input>

               <Input label="Source" style="separator"/>
               <Input name="source" style="text-editor">
                  <Default>
                     <![CDATA[
--
--  Insert your own function code here
--
  declare var ${defaultdatatype};
  set var = ${defaultvalue};
  return var;]]>
                  </Default>
               </Input>

               <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "\n(" + #parameters + ")"'/>

               <Command exectype="asis">
                  <SQL>
                     <![CDATA[
create function "${schema}"."${functionName}" ${_parameters}
returns ${returns}
language sql
${deterministic}
${option}
begin
${source}
end]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Function ${schema}.${functionName} created.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-functions-create93" label="Create Function" reload="true" icon="add"
                    doclink="http://www.dbvis.com/doclink/create-function">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" name="functionName" style="text"/>
               <Input label="Specific Name" name="specificName" style="text"/>
               <Input label="Return Data Type" name="returns" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
                  <Default>${defaultdatatype}</Default>
               </Input>
               <Input label="Deterministic" name="deterministic" style="radio">
                  <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
                  <Default>NOT DETERMINISTIC</Default>
               </Input>
               <Input label="Access Option" name="option" style="list">
                  <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
                  <Default>READS SQL DATA</Default>
               </Input>

               <Input label="Parameters" style="separator"/>

               <Input name="parameters" style="grid">
                  <Arg name="output" value='IN "${name}" ${type}'/>
                  <Arg name="newline" value=", "/>

                  <Input name="name" label="Name" style="text">
                     <Default>P1</Default>
                  </Input>
                  <Input name="type" label="Type" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDataTypeListByType">
                           <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                        </Command>
                     </Values>
                     <Default>${defaultdatatype}</Default>
                  </Input>
               </Input>

               <Input label="Source" style="separator"/>
               <Input name="source" style="text-editor">
                  <Default>
                     <![CDATA[
--
--  Insert your own function code here
--
  declare var ${defaultdatatype};
  set var = ${defaultvalue};
  return var;]]>
                  </Default>
               </Input>

               <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "\n(" + #parameters + ")"'/>
               <SetVar name="_specificName" value='#specificName.trim().equals("") ? "" : "SPECIFIC \"" + #specificName + "\""'/>

               <Command exectype="asis">
                  <SQL>
                     <![CDATA[
CREATE FUNCTION "${schema}"."${functionName}" ${_parameters}
RETURNS ${returns}
LANGUAGE SQL
${_specificName}
${deterministic}
${option}
BEGIN
${source}
END]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Function ${schema}.${functionName} created.]]>
               </Result>
            </Action>
         </Else>
      </ActionGroup>

      <ActionGroup type="Function">
         <If test="#util.isDatabaseVersionLTE(9,2)">
            <!-- Version 9.2 or earlier -->
            <Action id="mimer-function-comment92" label="Comment Function" icon="commentEdit" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Comment" name="comment" style="wrapped-text-editor">
                  <Default>
                     <Command idref="mimer.getSchemaObjectRemark">
                        <Input name="object_type" value="FUNCTION"/>
                     </Command>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[comment on function "${schema}"."${objectname}" is '${comment}']]></SQL>
               </Command>
               <Result>
                  <![CDATA[Comment for function <b>${schema}.${objectname}</b> updated.]]>
               </Result>
            </Action>

            <Action id="mimer-function-drop92" label="Drop Function" reload="true" icon="remove">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Drop Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[drop function "${schema}"."${objectname}" ${option}]]></SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the function, such as views, other functions, and procedures' : ''"/>
               <Confirm>
                  <![CDATA[Really drop function <b>${schema}.${objectname}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[Function <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
               </Result>
            </Action>

            <Action id="mimer-function-grant92" label="Grant Execute" icon="grant" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Grantee" name="grantee" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getGrantees">
                        <Input name="exclude_ident" value=""/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Grant Option" name="option" style="check">
                  <Values>WITH GRANT OPTION</Values>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[grant execute 
on function "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Execute on function <b>${schema}.${objectname}</b> granted to ${grantee}.]]>
               </Result>
            </Action>

            <Action id="mimer-function-revoke92" label="Revoke Execute" icon="revoke" reload="true">
               <Input label="Grant Option" name="grantOption" style="check">
                  <Values>GRANT OPTION for</Values>
               </Input>
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Grantee" name="ident" style="list">
                  <Values>
                     <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                        <Input name="object_type" value="FUNCTION"/>
                        <Input name="privilege_type" value="EXECUTE"/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Revoke Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[revoke ${grantOption} execute 
on function "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
                  </SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as other procedures and functions' : ''"/>
               <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
               <Confirm>
                  <![CDATA[Really revoke ${_grantOptionText}execute privilege on function <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[<b>${grantOption}</b> execute on procedure <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-function-comment" label="Comment Function" icon="commentEdit" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Comment" name="comment" style="wrapped-text-editor">
                  <Default>
                     <Command idref="mimer.getSchemaSpecificObjectRemark">
                        <Input name="object_type" value="FUNCTION"/>
                     </Command>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[comment on specific function "${schema}"."${specificname}" is '${comment}']]></SQL>
               </Command>
               <Result>
                  <![CDATA[Comment for specific function <b>${schema}.${specificname}</b> updated.]]>
               </Result>
            </Action>

            <Action id="mimer-function-drop" label="Drop Function" reload="true" icon="remove">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Drop Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[drop specific function "${schema}"."${specificname}" ${option}]]></SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the function, such as views, other functions, and procedures' : ''"/>
               <Confirm>
                  <![CDATA[Really drop specific function <b>${schema}.${specificname}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[Specific function <b>${schema}.${specificname}</b> dropped with <b>${option}</b> option.]]>
               </Result>
            </Action>

            <Action id="mimer-function-grant" label="Grant Execute" icon="grant" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Grantee" name="grantee" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getGrantees">
                        <Input name="exclude_ident" value=""/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Grant Option" name="option" style="check">
                  <Values>WITH GRANT OPTION</Values>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[grant execute 
on specific function "${schema}"."${specificname}" 
to "${grantee}" ${option}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Execute on specific function <b>${schema}.${specificname}</b> granted to ${grantee}.]]>
               </Result>
            </Action>

            <Action id="mimer-function-revoke" label="Revoke Execute" icon="revoke" reload="true">
               <Input label="Grant Option" name="grantOption" style="check">
                  <Values>GRANT OPTION for</Values>
               </Input>
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Function" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Grantee" name="ident" style="list">
                  <Values>
                     <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                        <Input name="object_type" value="FUNCTION"/>
                        <Input name="privilege_type" value="EXECUTE"/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Revoke Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[revoke ${grantOption} execute 
on specific function "${schema}"."${specificname}" 
from "${ident}" ${option}]]>
                  </SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as other procedures and functions' : ''"/>
               <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
               <Confirm>
                  <![CDATA[Really revoke ${_grantOptionText}execute privilege on specific function <b>${schema}.${specificname}</b> from <b>${ident}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[<b>${grantOption}</b> execute on specific function <b>${schema}.${specificname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
               </Result>
            </Action>

         </Else>
         <Action id="mimer-function-test" label="Script: Test Function" icon="ActionExecute" resultaction="mergeasscript" resulttarget="editor">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Function" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[
select 'select "${schema}"."${objectname}"(' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    ' || 
case when ORDINAL_POSITION = 1 then ' ' else ',' end ||
trim (trailing from 
case P.DATA_TYPE when 'BINARY' then 'X'''
                 when 'BINARY VARYING' then 'X'''
                 when 'BINARY LARGE OBJECT' then 'X'''
                 when 'CHARACTER' then '''' 
                 when 'CHARACTER LARGE OBJECT' then '''' 
                 when 'CHARACTER VARYING' then '''' 
                 when 'DATE' then 'DATE '''
                 when 'INTERVAL' then 'INTERVAL '''
                 when 'NATIONAL CHARACTER' then 'N'''
                 when 'NATIONAL CHARACTER LARGE OBJECT' then 'N'''
                 when 'NATIONAL CHARACTER VARYING' then 'N'''
                 when 'TIME' then 'TIME '''
                 when 'TIMESTAMP' then 'TIMESTAMP '''
                 else '' 
                 end) ||
'$' || '{' || PARAMETER_NAME || ' (' || P.DATA_TYPE || coalesce(' ' ||  P.INTERVAL_TYPE,'') || ')||(null)||||nobind }' || '$' ||
case when P.DATA_TYPE in (
     'BINARY',
     'BINARY VARYING',
     'BINARY LARGE OBJECT',
     'CHARACTER',
     'CHARACTER LARGE OBJECT', 
     'CHARACTER VARYING',
     'DATE',
     'NATIONAL CHARACTER',
     'NATIONAL CHARACTER LARGE OBJECT',
     'NATIONAL CHARACTER VARYING',
     'TIME',
     'TIMESTAMP') then ''''
else case when P.DATA_TYPE = 'INTERVAL' then '''' || P.INTERVAL_TYPE 
     else ''
     end 
end
from INFORMATION_SCHEMA.PARAMETERS P, INFORMATION_SCHEMA.ROUTINES R
where R.ROUTINE_SCHEMA = '${schema}'
and R.ROUTINE_NAME = '${objectname}'
and R.SPECIFIC_NAME = '${specificname}'
and R.ROUTINE_TYPE = 'FUNCTION'
and R.SPECIFIC_SCHEMA = P.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = P.SPECIFIC_NAME
union all
select '    ) as "${objectname}_RESULT" from INFORMATION_SCHEMA.EXT_ONEROW' from INFORMATION_SCHEMA.EXT_ONEROW
              ]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Script for function call to <b>${schema}.${objectname}</b> created.]]>
            </Result>
         </Action>

         <Action id="mimer-function-export" label="Export Function" icon="export"
                 class="functionExport"
                 doclink="http://www.dbvis.com/doclink/export-code-object"/>

         <Separator/>

         <Action id="mimer-function-script" label="Script Function" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CALL,CREATE,DROP"/>
      </ActionGroup>

      <ActionGroup type="Procedures">
         <If test="#util.isDatabaseVersionLTE(9,2)">
            <!-- Version 9.2 or earlier -->
            <Action id="mimer-procedures-create92" label="Create Procedure" reload="true" icon="add"
                    doclink="http://www.dbvis.com/doclink/create-procedure">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" name="procedureName" style="text"/>
               <Input label="Deterministic" name="deterministic" style="radio">
                  <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
                  <Default>NOT DETERMINISTIC</Default>
               </Input>
               <Input label="Access Option" name="option" style="list">
                  <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
                  <Default>READS SQL DATA</Default>
               </Input>
               <Input label="Parameters" style="separator"/>

               <Input name="parameters" style="grid">
                  <Arg name="output" value='${direction} "${name}" ${type}'/>
                  <Arg name="newline" value=", "/>

                  <Input name="name" label="Name" style="text">
                     <Default>P1</Default>
                  </Input>
                  <Input name="direction" label="Direction" style="list">
                     <Values>IN|INOUT|OUT</Values>
                     <Default>IN</Default>
                  </Input>
                  <Input name="type" label="Type" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDataTypeListByType">
                           <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                        </Command>
                     </Values>
                     <Default>${defaultdatatype}</Default>
                  </Input>
               </Input>

               <Input label="Source" style="separator"/>
               <Input name="source" style="text-editor">
                  <Default>
                     <![CDATA[
--
--  Insert your own procedure code here
--
    declare var1 integer;
    set var1 = 10;]]>
                  </Default>
               </Input>

               <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "\n(" + #parameters + ")"'/>

               <Command exectype="asis">
                  <SQL>
                     <![CDATA[
create procedure "${schema}"."${procedureName}" ${_parameters} 
language sql 
${deterministic} 
${option} 
begin 
${source} 
end]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Procedure <b>${schema}.${procedureName}</b> created.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-procedures-create93" label="Create Procedure" reload="true" icon="add"
                    doclink="http://www.dbvis.com/doclink/create-procedure">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" name="procedureName" style="text"/>
               <Input label="Specific Name" name="specificName" style="text"/>
               <Input label="Deterministic" name="deterministic" style="radio">
                  <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
                  <Default>NOT DETERMINISTIC</Default>
               </Input>
               <Input label="Access Option" name="option" style="list">
                  <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
                  <Default>READS SQL DATA</Default>
               </Input>
               <Input label="Parameters" style="separator"/>

               <Input name="parameters" style="grid">
                  <Arg name="output" value='${direction} "${name}" ${type}'/>
                  <Arg name="newline" value=", "/>

                  <Input name="name" label="Name" style="text">
                     <Default>P1</Default>
                  </Input>
                  <Input name="direction" label="Direction" style="list">
                     <Values>IN|INOUT|OUT</Values>
                     <Default>IN</Default>
                  </Input>
                  <Input name="type" label="Type" editable="true" style="list">
                     <Values>
                        <Command idref="mimer.getDataTypeListByType">
                           <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                        </Command>
                     </Values>
                     <Default>${defaultdatatype}</Default>
                  </Input>
               </Input>

               <Input label="Source" style="separator"/>
               <Input name="source" style="text-editor">
                  <Default>
                     <![CDATA[
--
--  Insert your own procedure code here
--
    declare var1 integer;
    set var1 = 10;]]>
                  </Default>
               </Input>

               <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "\n(" + #parameters + ")"'/>
               <SetVar name="_specificName" value='#specificName.trim().equals("") ? "" : "SPECIFIC \"" + #specificName + "\""'/>

               <Command exectype="asis">
                  <SQL>
                     <![CDATA[
CREATE PROCEDURE "${schema}"."${procedureName}" ${_parameters} 
LANGUAGE SQL 
${_specificName} 
${deterministic} 
${option} 
BEGIN 
${source} 
END]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Procedure <b>${schema}.${procedureName}</b> created.]]>
               </Result>
            </Action>
         </Else>
      </ActionGroup>

      <ActionGroup type="Procedure">
         <If test="#util.isDatabaseVersionLTE(9,2)">
            <!-- Version 9.2 or earlier -->
            <Action id="mimer-procedure-comment92" label="Comment Procedure" icon="commentEdit" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Comment" name="comment" style="wrapped-text-editor">
                  <Default>
                     <Command idref="mimer.getSchemaObjectRemark">
                        <Input name="object_type" value="PROCEDURE"/>
                     </Command>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[comment on procedure "${schema}"."${objectname}" is '${comment}']]></SQL>
               </Command>
               <Result>
                  <![CDATA[Comment for procedure <b>${schema}.${objectname}</b> updated.]]>
               </Result>
            </Action>

            <Action id="mimer-procedure-drop92" label="Drop Procedure" reload="true" icon="remove">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Drop Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[drop procedure "${schema}"."${objectname}" ${option}]]></SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the procedure, such as functions and other procedures' : ''"/>
               <Confirm>
                  <![CDATA[Really drop procedure <b>${schema}.${objectname}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[Procedure <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
               </Result>
            </Action>

            <Action id="mimer-procedure-grant92" label="Grant Execute" icon="grant" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Grantee" name="grantee" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getGrantees">
                        <Input name="exclude_ident" value=""/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Grant Option" name="option" style="check">
                  <Values>WITH GRANT OPTION</Values>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[grant execute 
on procedure "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Execute on procedure <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
               </Result>
            </Action>

            <Action id="mimer-procedure-revoke92" label="Revoke Execute" icon="revoke" reload="true">
               <Input label="Grant Option" name="grantOption" style="check">
                  <Values>GRANT OPTION for</Values>
               </Input>
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Grantee" name="ident" style="list">
                  <Values>
                     <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                        <Input name="object_type" value="PROCEDURE"/>
                        <Input name="privilege_type" value="EXECUTE"/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Revoke Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[revoke ${grantOption} execute 
on procedure "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
                  </SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the procedure, such as functions and other procedures' : ''"/>
               <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
               <Confirm>
                  <![CDATA[Really revoke ${_grantOptionText}execute privilege on procedure <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[<b>${grantOption}</b> execute on procedure <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-procedure-comment" label="Comment Procedure" icon="commentEdit" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Comment" name="comment" style="wrapped-text-editor">
                  <Default>
                     <Command idref="mimer.getSchemaSpecificObjectRemark">
                        <Input name="object_type" value="PROCEDURE"/>
                     </Command>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[comment on specific procedure "${schema}"."${specificname}" is '${comment}']]></SQL>
               </Command>
               <Result>
                  <![CDATA[Comment for specific procedure <b>${schema}.${specificname}</b> updated.]]>
               </Result>
            </Action>

            <Action id="mimer-procedure-drop" label="Drop Procedure" reload="true" icon="remove">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Drop Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[drop specific procedure "${schema}"."${specificname}" ${option}]]></SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the procedure, such as functions and other procedures' : ''"/>
               <Confirm>
                  <![CDATA[Really drop specific procedure <b>${schema}.${specificname}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[Specific procedure <b>${schema}.${specificname}</b> dropped with <b>${option}</b> option.]]>
               </Result>
            </Action>

            <Action id="mimer-procedure-grant" label="Grant Execute" icon="grant" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Grantee" name="grantee" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getGrantees">
                        <Input name="exclude_ident" value=""/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Grant Option" name="option" style="check">
                  <Values>WITH GRANT OPTION</Values>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[grant execute 
on specific procedure "${schema}"."${specificname}" 
to "${grantee}" ${option}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Execute on specific procedure <b>${schema}.${specificname}</b> granted to <b>${grantee}</b>.]]>
               </Result>
            </Action>

            <Action id="mimer-procedure-revoke" label="Revoke Execute" icon="revoke" reload="true">
               <Input label="Grant Option" name="grantOption" style="check">
                  <Values>GRANT OPTION for</Values>
               </Input>
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Procedure" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Specific name" style="text" editable="false">
                  <Default>${specificname}</Default>
               </Input>
               <Input label="Grantee" name="ident" style="list">
                  <Values>
                     <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                        <Input name="object_type" value="PROCEDURE"/>
                        <Input name="privilege_type" value="EXECUTE"/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Revoke Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[revoke ${grantOption} execute 
on specific procedure "${schema}"."${specificname}" 
from "${ident}" ${option}]]>
                  </SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the procedure, such as functions and other procedures' : ''"/>
               <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
               <Confirm>
                  <![CDATA[Really revoke ${_grantOptionText}execute privilege on specific procedure <b>${schema}.${specificname}</b> from <b>${ident}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[<b>${grantOption}</b> execute on specific procedure <b>${schema}.${specificname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
               </Result>
            </Action>
         </Else>

         <Action id="mimer-procedure-export" label="Export Procedure" icon="export"
                 class="procedureExport"
                 doclink="http://www.dbvis.com/doclink/export-code-object"/>

         <Separator/>

         <Action id="mimer-procedure-script" label="Script Procedure" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CALL,CREATE,DROP"/>
      </ActionGroup>

      <ActionGroup type="Modules">
         <Action id="mimer-modules-create" label="Create Module" reload="true" icon="add">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Module" name="moduleName" style="text"/>
            <Input label="Procedure" name="procedureName" style="text"/>
            <Input label="Deterministic" name="deterministic" style="radio">
               <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
               <Default>NOT DETERMINISTIC</Default>
            </Input>
            <Input label="Access Option" name="option" style="list">
               <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
               <Default>READS SQL DATA</Default>
            </Input>
            <Input label="Parameters" style="separator"/>

            <Input name="parameters" style="grid">
               <Arg name="output" value='${direction} "${name}" ${type}'/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text">
                  <Default>parm</Default>
               </Input>
               <Input name="direction" label="Direction" style="list">
                  <Values>IN|INOUT|OUT</Values>
                  <Default>IN</Default>
               </Input>
               <Input name="type" label="Type" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
               </Input>
            </Input>

            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own procedure code here
--  You can declare several procedures/functions in a module
--
    declare P1 integer;
    set P1 = 10;]]>
               </Default>
            </Input>

            <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "\n(" + #parameters + ")"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
create module "${schema}"."${moduleName}" 
declare procedure "${schema}"."${procedureName}" ${_parameters} 
language sql 
${deterministic} 
${option} 
begin 
${source} 
end; 
end module]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Module <b>${schema}.${moduleName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Module">
         <Action id="mimer-module-comment" label="Comment Module" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Module" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="MODULE"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on module "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for module <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-module-drop" label="Drop Module" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Module" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop module "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use procedures and functions in the module' : ''"/>
            <Confirm>
               <![CDATA[Really drop module <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Module <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-module-export" label="Export Module" icon="export"
                 class="moduleExport"
                 doclink="http://www.dbvis.com/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="Triggers">
         <Action id="mimer-triggers-createtable" label="Create Table Trigger" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Time" name="triggerTime" style="radio">
               <Values>BEFORE|AFTER</Values>
               <Default>AFTER</Default>
            </Input>
            <Input label="Trigger Event" name="triggerEvent" style="radio">
               <Values>DELETE|INSERT|UPDATE</Values>
               <Default>INSERT</Default>
            </Input>
            <Input label="Table" name="table" style="list">
               <Values>
                  <Command idref="mimer.getTableByType">
                     <Input name="table_type" value="'BASE TABLE'"/>
                  </Command>
               </Values>
               <Default>${theTableName}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own trigger code here
--
    declare P1 integer;
    set P1 = 10;
    if  P1 = 10 then
        signal sqlstate 'TA400';
    end if;]]>
               </Default>
            </Input>

            <SetVar name="_refd" value='#triggerEvent.equals("DELETE") ? "referencing old table as \"OLD_" + #table + "\"" : ""'/>
            <SetVar name="_refi" value='#triggerEvent.equals("INSERT") ? "referencing new table as \"NEW_" + #table + "\"" : ""'/>
            <SetVar name="_refu" value='#triggerEvent.equals("UPDATE") ? "referencing old table as \"OLD_" + #table + "\" new table as \"NEW_" + #table + "\"" : ""'/>

            <SetVar name="_ref1" value="#_refi.equals('') ? #_refd : #_refi"/>
            <SetVar name="_ref2" value="#_refu.equals('') ? #_ref1 : #_refu"/>

            <SetVar name="_references" value="#triggerTime.equals('BEFORE') ? '' : '\n' + #_ref2"/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
create trigger "${schema}"."${triggerName}" 
${triggerTime} ${triggerEvent} 
on "${schema}"."${table}"${_references} 
for each statement 
begin atomic 
${source} 
end]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>

         <Action id="mimer-triggers-createview" label="Create View Trigger" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Event" name="triggerEvent" style="radio">
               <Values>DELETE|INSERT|UPDATE</Values>
               <Default>INSERT</Default>
            </Input>
            <Input label="View" name="view" style="list">
               <Values>
                  <Command idref="mimer.getTableByType">
                     <Input name="table_type" value="'VIEW'"/>
                  </Command>
               </Values>
               <Default>${theTableName}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own trigger code here
--
    declare P1 integer;
    set P1 = 10;
    if  P1 = 10 then
        signal sqlstate 'TA400';
    end if;]]>
               </Default>
            </Input>

            <SetVar name="_refd" value='#triggerEvent.equals("DELETE") ? "referencing old table as \"OLD_" + #view + "\"" : ""'/>
            <SetVar name="_refi" value='#triggerEvent.equals("INSERT") ? "referencing new table as \"NEW_" + #view + "\"" : ""'/>
            <SetVar name="_refu" value='#triggerEvent.equals("UPDATE") ? "referencing old table as \"OLD_" + #view + "\" new table as \"NEW_" + #view + "\"" : ""'/>

            <SetVar name="_ref1" value="#_refi.equals('') ? #_refd : #_refi"/>
            <SetVar name="_ref2" value="#_refu.equals('') ? #_ref1 : #_refu"/>

            <SetVar name="_references" value="#_ref2.equals('') ? '' : '\n' + #_ref2"/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
create trigger "${schema}"."${triggerName}" 
instead of ${triggerEvent} 
on "${schema}"."${view}"${_references} 
for each statement 
begin atomic 
${source} 
end]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Trigger">
         <Action id="mimer-trigger-comment" label="Comment Trigger" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="TRIGGER"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on trigger "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for trigger <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-trigger-drop" label="Drop Trigger" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Condition timing" name="timing" style="text" editable="false">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select ]]>
                        <If test="#util.isDatabaseVersionGTE(10,1)">
                           <![CDATA[ACTION_TIMING]]>
                        </If>
                        <Else>
                           <![CDATA[CONDITION_TIMING]]>
                        </Else>
                        <![CDATA[
from INFORMATION_SCHEMA.TRIGGERS
where TRIGGER_SCHEMA = '${schema}'
and TRIGGER_NAME = '${objectname}'
                ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop trigger "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_timing" value="#timing.equals('INSTEAD OF') ? '&lt;br>and all dependent objects that use the fact that the instead of view is updatable' : ''"/>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? #_timing : ''"/>
            <Confirm>
               <![CDATA[Really drop trigger <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Trigger <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-trigger-export" label="Export Trigger" icon="export"
                 class="triggerExport"
                 doclink="http://www.dbvis.com/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="DistinctTypes">
         <Action id="mimer-distincttypes-create" label="Create Distinct Type" reload="true" icon="add">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text"/>
            <Input label="Data Type" name="dataType" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDataTypeListByType">
                     <Input name="type_categories" value="'DATA TYPE'"/>
                  </Command>
               </Values>
            </Input>
            <Input label="Collation" name="collateClause" style="list">
               <Labels>
                  <Command idref="mimer.getCollationList"/>
               </Labels>
               <Values>
                  <Command idref="mimer.getCollationQuotedList"/>
               </Values>
            </Input>

            <SetVar name="_collate" value="#collateClause.equals('') ? '' : 'collate ' + #collateClause"/>

            <Command>
               <SQL>
                  <![CDATA[create type "${schema}"."${typeName}" as 
${dataType} ${_collate}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Distinct user defined type <b>${schema}.${typeName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="StructuredTypes">
         <Action id="mimer-structuredtypes-create" label="Create Structured Type" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text"/>

            <Input label="Attributes" style="separator"/>

            <Input name="attributes" style="grid">
               <Arg name="output" value='"${attributename}" ${dataType}${_collation}${_default}'/>
               <Arg name="newline" value=", "/>

               <Input label="Attribute name" name="attributename" style="text"/>
               <Input label="Data Type" name="dataType" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
               </Input>
               <Input name="collation" label="Collation" style="list">
                  <Labels>
                     <Command idref="mimer.getCollationList"/>
                  </Labels>
                  <Values>
                     <Command idref="mimer.getCollationQuotedList"/>
                  </Values>
               </Input>
               <Input label="Default value" name="defaultClause" style="text"/>

               <SetVar name="_default" value="#defaultClause.equals('') ? '' : '\ndefault ' + #defaultClause"/>
               <SetVar name="_collation" value='#collation.equals("") ? "" : " collate " + #collation'/>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[create type "${schema}"."${typeName}" as (
${attributes})]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Structured user defined type <b>${schema}.${typeName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="DistinctType">
         <Action id="mimer-distincttype-comment" label="Comment User Defined Type" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="USER DEFINED TYPE"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on type "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for user defined type <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-distincttype-drop" label="Drop User Defined Type" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop type "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop user defined type <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[User defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-distincttype-grant" label="Grant Usage" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant usage 
on type "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Usage on type <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-distincttype-revoke" label="Revoke Usage" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForSchemaObjectPrivileges">
                     <Input name="object_type" value="USER DEFINED TYPE"/>
                     <Input name="privilege_type" value="USAGE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} usage 
on type "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${ident}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}usage privilege on user defined type <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_usage" value="#grantOption.equals('') ? 'Usage' : 'usage'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_usage} privilege on type <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Attributes">
         <Action id="mimer-attributes-add" label="Add User Defined Type Attribute" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Attribute Name" name="attributeName" style="text"/>
            <Input label="Data Type" name="dataType" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDataTypeListByType">
                     <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                  </Command>
               </Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${typeName}" 
add attribute "${attributeName}" ${dataType}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Attribute <b>${attributeName}</b> with type <b>${typeName}</b> added to user defined type <b>${schema}.${typeName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Attribute">
         <Action id="mimer-attribute-drop" label="Drop User Defined Type Attribute" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <!--<Input label="Drop Option" name="option" style="radio">
           <Labels>RESTRICT|CASCADE</Labels>
           <Values>restrict|cascade</Values>
           <Default>RESTRICT</Default>
         </Input>-->
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${udtname}" drop attribute "${objectname}" RESTRICT]]></SQL>
            </Command>
            <!--<SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>-->
            <Confirm>
               <![CDATA[Really drop user defined type attribute <b>${objectname}</b> for type <b>${schema}.${udtname}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Attribute ${objectname} for user defined type <b>${schema}.${udtname}</b> dropped.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="StructuredType">
         <Action id="mimer-structuredtype-comment" label="Comment User Defined Type" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="USER DEFINED TYPE"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on type "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for user defined type <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-structuredtype-drop" label="Drop User Defined Type" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop type "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop user defined type <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[User defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-structuredtype-grant" label="Grant Usage" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant usage 
on type "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Usage on type <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-structuredtype-revoke" label="Revoke Usage" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForSchemaObjectPrivileges">
                     <Input name="object_type" value="USER DEFINED TYPE"/>
                     <Input name="privilege_type" value="USAGE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} usage 
on type "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${ident}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}usage privilege on user defined type <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_usage" value="#grantOption.equals('') ? 'Usage' : 'usage'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_usage} privilege on type <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ConstructorMethods">
         <Action id="mimer-constructormethods-add" label="Add Constructor Method Specification" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific Name" name="specificName" style="text"/>
            <Input label="Deterministic" name="deterministic" style="radio">
               <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
               <Default>DETERMINISTIC</Default>
            </Input>
            <Input label="Access Option" name="option" style="list">
               <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
               <Default>CONTAINS SQL</Default>
            </Input>
            <Input label="Parameter Data Types" style="separator"/>
            <Input name="dataTypeList" style="grid">
               <Arg name="output" value='"${name}" ${dataType}'/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text"/>
               <Input label="Data Type" name="dataType" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
               </Input>
            </Input>
            <SetVar name="_specificName" value='#specificName.trim().equals("") ? "" : "SPECIFIC \"" + #specificName + "\" "'/>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${typeName}" add constructor method "${schema}"."${typeName}"(
${dataTypeList})
returns "${schema}"."${typeName}"
${_specificName}${deterministic} ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Constructor method specification for user defined type <b>${schema}.${typeName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ConstructorMethod">
         <Action id="mimer-constructormethod-comment" label="Comment Constructor Method" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaSpecificObjectRemark">
                     <Input name="object_type" value="CONSTRUCTOR METHOD"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on specific method "${schema}"."${specificname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for constructor method <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-constructormethod-drop" label="Drop Constructor Method" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop specific method "${specificname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop method <b>${method}</b> for user defined type ${schema}.${objectname}${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Method ${method} for user defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-constructormethod-grant" label="Grant Execute" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant execute 
on specific method "${schema}"."${specificname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Execute on constructor method <b>${objectname}</b> granted to ${grantee}.]]>
            </Result>
         </Action>

         <Action id="mimer-constructormethod-revoke" label="Revoke Execute" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                     <Input name="object_type" value="CONSTRUCTOR METHOD"/>
                     <Input name="privilege_type" value="EXECUTE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} execute 
on specific method "${schema}"."${specificname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as other procedures and functions' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}execute privilege on constructor method <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[<b>${grantOption}</b> execute on constructor method <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ConstructorMethodUndef">
         <Action id="mimer-constructormethodundef-create" label="Create Constructor Method" icon="add" reload="true"
                 doclink="http://www.dbvis.com/doclink/create-code-object">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Return Data Type" editable="false" style="text">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select '--' || ascii_char(10) || 
       '--  Insert your own code to initialize the ${udtname} instance' || ascii_char(10) || 
       '--' || ascii_char(10) ||
       '--  set self.attr1 = param1;' || ascii_char(10)
from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'set self."' || A.ATTRIBUTE_NAME  || '" = "' || MSP.PARAMETER_NAME || '"' || ascii_char(10)
from INFORMATION_SCHEMA.METHOD_SPECIFICATION_PARAMETERS MSP, INFORMATION_SCHEMA.ATTRIBUTES A
where A.UDT_SCHEMA = '${schema}'
and A.UDT_NAME = '${udtname}'
and MSP.ORDINAL_POSITION = A.ORDINAL_POSITION
and MSP.SPECIFIC_SCHEMA = A.UDT_SCHEMA
and MSP.SPECIFIC_NAME = '${specificname}'
union all
select 'return self;'
from INFORMATION_SCHEMA.EXT_ONEROW
]]>
                        <!-- - -  set self.attr1 = param1;
    return self; 
               </SQL>
             </Command>
             <![CDATA[
- -
- -  Insert your own code to initialize the ${udtname} instance
- -
- -  set self.attr1 = param1;
    return self;]]>-->
                     </SQL>
                  </Command>
               </Default>
            </Input>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE SPECIFIC METHOD "${schema}"."${specificname}"
BEGIN
${source}
END]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Method ${schema}.${specificname} created.]]>
            </Result>
         </Action>
         <Action id="mimer-constructormethodundef-drop" label="Drop Constructor Method Specification" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[alter type "${schema}"."${objectname}" 
drop specific method "${specificname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop method <b>${method}</b> for user defined type ${schema}.${objectname}${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Method ${method} for user defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="InstanceMethods">
         <Action id="mimer-instancemethods-add" label="Add Instance Method Specification" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Method Name" name="methodName" style="text"/>
            <Input label="Specific Name" name="specificName" style="text"/>
            <Input label="Return Data Type" name="returns" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDataTypeListByType">
                     <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                  </Command>
               </Values>
               <Default>${schema}.${udtname}</Default>
            </Input>
            <Input label="Deterministic" name="deterministic" style="radio">
               <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
               <Default>DETERMINISTIC</Default>
            </Input>
            <Input label="Access Option" name="option" style="list">
               <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
               <Default>CONTAINS SQL</Default>
            </Input>
            <Input label="Parameter Data Types" style="separator"/>
            <Input name="dataTypeList" style="grid">
               <Arg name="output" value='"${name}" ${dataType}'/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text"/>
               <Input label="Data Type" name="dataType" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
               </Input>
            </Input>
            <SetVar name="_specificName" value='#specificName.trim().equals("") ? "" : "SPECIFIC \"" + #specificName + "\" "'/>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${typeName}" add instance method "${methodName}"(
${dataTypeList})
returns ${returns}
${_specificName}${deterministic} ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Instance method specification ${methodName} for user defined type <b>${schema}.${typeName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="InstanceMethodUndef">
         <Action id="mimer-instancemethodundef-create" label="Create Instance Method" icon="add" reload="true"
                 doclink="http://www.dbvis.com/doclink/create-code-object">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Return Data Type" editable="false" style="text">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own method code here
--
  declare var "${schema}"."${udtname}" ;
  set var = new "${schema}"."${udtname}"();
  return var;]]>
               </Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE SPECIFIC METHOD "${schema}"."${objectname}"
BEGIN
${source}
END]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Function ${schema}.${functionName} created.]]>
            </Result>
         </Action>
         <Action id="mimer-instancemethodundef-drop" label="Drop Instance Method Specification" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[alter type "${schema}"."${udtname}" 
drop specific method "${specificname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop method <b>${method}</b> for user defined type ${schema}.${objectname}${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Method ${method} for user defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="InstanceMethod">
         <Action id="mimer-instancemethod-comment" label="Comment Instance Method" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaSpecificObjectRemark">
                     <Input name="object_type" value="INSTANCE METHOD"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on specific method "${schema}"."${specificname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for instance method <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-instancemethod-drop" label="Drop Instance Method" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop specific method "${specificname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop method <b>${method}</b> for user defined type ${schema}.${objectname}${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Method ${method} for user defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-instancemethod-grant" label="Grant Execute" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant execute 
on specific method "${schema}"."${specificname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Execute on instance method <b>${objectname}</b> granted to ${grantee}.]]>
            </Result>
         </Action>

         <Action id="mimer-instancemethod-revoke" label="Revoke Execute" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                     <Input name="object_type" value="INSTANCE METHOD"/>
                     <Input name="privilege_type" value="EXECUTE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} execute 
on specific method "${schema}"."${specificname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as other procedures and functions' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}execute privilege on instance method <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[<b>${grantOption}</b> execute on instance method <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="StaticMethods">
         <Action id="mimer-staticmethods-add" label="Add Static Method Specification" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Method Name" name="methodName" style="text"/>
            <Input label="Specific Name" name="specificName" style="text"/>
            <Input label="Return Data Type" name="returns" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDataTypeListByType">
                     <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                  </Command>
               </Values>
               <Default>${schema}.${udtname}</Default>
            </Input>
            <Input label="Deterministic" name="deterministic" style="radio">
               <Values>NOT DETERMINISTIC|DETERMINISTIC</Values>
               <Default>DETERMINISTIC</Default>
            </Input>
            <Input label="Access Option" name="option" style="list">
               <Values>CONTAINS SQL|READS SQL DATA|MODIFIES SQL DATA</Values>
               <Default>CONTAINS SQL</Default>
            </Input>
            <Input label="Parameter Data Types" style="separator"/>
            <Input name="dataTypeList" style="grid">
               <Arg name="output" value='"${name}" ${dataType}'/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text"/>
               <Input label="Data Type" name="dataType" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getDataTypeListByType">
                        <Input name="type_categories" value="'DATA TYPE','UDT'"/>
                     </Command>
                  </Values>
               </Input>
            </Input>
            <SetVar name="_specificName" value='#specificName.trim().equals("") ? "" : "SPECIFIC \"" + #specificName + "\" "'/>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${typeName}" add static method "${methodName}"(
${dataTypeList})
returns ${returns}
${_specificName}${deterministic} ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Static method specification ${methodName} for user defined type <b>${schema}.${typeName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="StaticMethodUndef">
         <Action id="mimer-staticmethodundef-create" label="Create Static Method" icon="add" reload="true"
                 doclink="http://www.dbvis.com/doclink/create-code-object">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Return Data Type" name="returnType" editable="false" style="text">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
                 select 
case when DATA_TYPE = 'USER-DEFINED' then
     case when RETURN_UDT_SCHEMA = CURRENT_USER then '' else RETURN_UDT_SCHEMA || '.' end ||
     RETURN_UDT_NAME
else DATA_TYPE collate SQL_IDENTIFIER ||
case DATA_TYPE
when 'DOUBLE PRECISION' then ''
when 'REAL' then ''
when 'FLOAT' then ''
when 'INTEGER' then ''
when 'SMALLINT' then ''
when 'BIGINT' then ''
when 'DATE' then ''
when 'INTERVAL'
then case INTERVAL_TYPE
     when 'YEAR TO MONTH'  then ' YEAR(' || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MONTH'
     when 'DAY TO HOUR'    then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO HOUR'
     when 'DAY TO MINUTE'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'DAY TO SECOND'  then ' DAY('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'HOUR TO MINUTE' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO MINUTE'
     when 'HOUR TO SECOND' then ' HOUR('  || cast(INTERVAL_PRECISION as varchar(1)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'MINUTE TO SECOND' then ' MINUTE('  || cast(INTERVAL_PRECISION as varchar(2)) || ') TO SECOND(' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     when 'SECOND' then ' SECOND('  || cast(INTERVAL_PRECISION as varchar(2)) || ', ' || cast(DATETIME_PRECISION as varchar(1)) || ')'
     else ' ' || INTERVAL_TYPE || '(' || cast(INTERVAL_PRECISION as varchar(2)) || ')'
     end
when 'DECIMAL' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
when 'NUMERIC' then '('  || cast(NUMERIC_PRECISION as varchar(2)) || ', ' || cast(NUMERIC_SCALE as varchar(2)) || ')'
else case when coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) is NULL then ''
     else '(' || cast(coalesce(NUMERIC_PRECISION,CHARACTER_MAXIMUM_LENGTH,LOB_MAXIMUM_LENGTH,DATETIME_PRECISION) as varchar(20)) || ')'
     end
end
end
from INFORMATION_SCHEMA.METHOD_SPECIFICATIONS
where UDT_SCHEMA = '${schema}'
and SPECIFIC_NAME = '${specificname}'
]]>
                     </SQL>
                     <Input name="object_type" value="STATIC METHOD"/>
                  </Command>
               </Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default>
                  <![CDATA[
--
--  Insert your own method code here and change the
--  assignment of var to match your return type
--
  declare var ${returnType};
  set var = N'ABC';
  return var;]]>
               </Default>
            </Input>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE SPECIFIC METHOD "${schema}"."${specificname}"
BEGIN
${source}
END]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Static method ${schema}.${objectname} for ${udtname} created.]]>
            </Result>
         </Action>
         <Action id="mimer-staticmethodundef-drop" label="Drop Static Method Specification" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${udtname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[alter type "${schema}"."${udtname}" 
drop specific method "${specificname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop method specification ${method} for user defined type ${schema}.${objectname}${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Method ${method} for user defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="StaticMethod">
         <Action id="mimer-staticmethod-comment" label="Comment Static Method" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaSpecificObjectRemark">
                     <Input name="object_type" value="STATIC METHOD"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on specific method "${schema}"."${specificname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for static method <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-staticmethod-drop" label="Drop Static Method" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific Name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop specific method "${specificname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the type, such as tables, views and procedures' : ''"/>
            <Confirm>
               <![CDATA[Really drop method <b>${method}</b> for user defined type ${schema}.${objectname}${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Method ${method} for user defined type <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-staticmethod-grant" label="Grant Execute" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant execute 
on specific method "${schema}"."${specificname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Execute on static method <b>${objectname}</b> granted to ${grantee}.]]>
            </Result>
         </Action>

         <Action id="mimer-staticmethod-revoke" label="Revoke Execute" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Method Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Specific name" style="text" editable="false">
               <Default>${specificname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForRoutineSchemaObjectPrivileges">
                     <Input name="object_type" value="STATIC METHOD"/>
                     <Input name="privilege_type" value="EXECUTE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} execute 
on specific method "${schema}"."${specificname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that depend on the privilege, such as other procedures and functions' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}execute privilege on static method <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[<b>${grantOption}</b> execute on static method <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Domains">
         <Action id="mimer-domains-create" label="Create Domain" reload="true" icon="add">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Domain" name="domainName" style="text"/>
            <Input label="Data Type" name="dataType" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getDataTypeListByType">
                     <Input name="type_categories" value="'DATA TYPE'"/>
                  </Command>
               </Values>
               <Default>${defaultdatatype}</Default>
            </Input>
            <If test="#util.isDatabaseVersionLT(9)">
            </If>
            <Else>
               <!-- Version 9.1 or later -->
               <Input label="Collation" name="collateClause" style="list">
                  <Labels>
                     <Command idref="mimer.getCollationList"/>
                  </Labels>
                  <Values>
                     <Command idref="mimer.getCollationQuotedList"/>
                  </Values>
               </Input>
            </Else>
            <Input label="Default value" name="defaultClause" style="text">
               <Default>${defaultvalue}</Default>
            </Input>
            <Input label="Constraint name" name="constraint" style="text"/>
            <Input label="Check" name="checkClause" style="text">
               <Default>value is not null and value &lt;&gt; 'xyz'</Default>
            </Input>

            <SetVar name="_default" value="#defaultClause.equals('') ? '' : '\ndefault ' + #defaultClause"/>
            <SetVar name="_collate" value="#collateClause.equals('') ? '' : 'collate ' + #collateClause"/>
            <SetVar name="_constraint1" value='#constraint.equals("") ? "" : "constraint \"" + #constraint + "\" "'/>
            <SetVar name="_constraint2" value="#checkClause.equals('') ? '' : #_constraint1"/>
            <SetVar name="_check" value="#checkClause.equals('') ? '' : 'check(' + #checkClause + ')'"/>
            <SetVar name="_hascheck" value="#_check.equals('') ? '' : '\n'"/>

            <Command>
               <SQL>
                  <![CDATA[create domain "${schema}"."${domainName}" as 
${dataType} ${_collate}${_default}${_hascheck}${_constraint2}${_check}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Domain <b>${schema}.${domainName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Domain">
         <Action id="mimer-domain-comment" label="Comment Domain" icon="commentEdit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Domain" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getSchemaObjectRemark">
                     <Input name="object_type" value="DOMAIN"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on domain "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for domain <b>${schema}.${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-domain-drop" label="Drop Domain" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Domain" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop domain "${schema}"."${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the domain, such as views and procedures (but not columns that use the domain)' : ''"/>
            <Confirm>
               <![CDATA[Really drop domain <b>${schema}.${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Domain <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-domain-grant" label="Grant Usage" icon="grant" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Domain" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant usage 
on domain "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Usage on domain <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-domain-revoke" label="Revoke Usage" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Domain" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForSchemaObjectPrivileges">
                     <Input name="object_type" value="DOMAIN"/>
                     <Input name="privilege_type" value="USAGE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} usage 
on domain "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
               </SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${ident}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}usage privilege on domain <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_usage" value="#grantOption.equals('') ? 'Usage' : 'usage'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_usage} privilege on domain <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <!--<ActionGroup label="Script object to SQL editor">
        <Action id="mimer-script-createdomain" label="Create Domain" resultaction="mergeasscript" resulttarget="editor">
          <Input label="Schema" style="text" editable="false">
            <Default>${schema}</Default>
          </Input>
          <Input label="Domain" style="text" editable="false">
            <Default>${objectname}</Default>
          </Input>
          <Command idref="mimer.getDomainSource">
            <Input name="domain_schema" value="${schema}"/>
            <Input name="domain_name" value="${objectname}"/>
            <Filter action="dropcolumn" index="CONSTRAINT_NAME"/>
            <Filter action="dropcolumn" index="LINE_NUMBER"/>
          </Command>
        </Action>
      </ActionGroup>-->
      </ActionGroup>

      <If test="#util.isDatabaseVersionLTE(9,1)">
      </If>
      <Else>
         <!-- Version 9.2 or later -->
         <ActionGroup type="Collations">
            <Action id="mimer-collation-create" label="Create Collation" reload="true" icon="add">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Collation" name="collationName" style="text"/>
               <Input label="Source Collation" name="sourceCollation" style="list">
                  <Labels>
                     <Command idref="mimer.getCollationList"/>
                  </Labels>
                  <Values>
                     <Command idref="mimer.getCollationQuotedList"/>
                  </Values>
                  <Default>"INFORMATION_SCHEMA"."EOR"</Default>
               </Input>
               <Input label="Using clause" style="separator"/>
               <Input name="usingClause" style="text-editor"/>
               <SetVar name="_usingClause" value="#usingClause.equals('') ? '' : '\nusing \'' + #usingClause + '\''"/>
               <Command>
                  <SQL>
                     <![CDATA[create collation "${schema}"."${collationName}" 
from ${sourceCollation}${_usingClause}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Collation <b>${schema}.${collationName}</b> created.]]>
               </Result>
            </Action>
         </ActionGroup>

         <ActionGroup type="Collation">
            <If test="#util.isDatabaseVersionLTE(9,2)">
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <Action id="mimer-collation-comment" label="Comment Collation" icon="commentEdit" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Collation" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Comment" name="comment" style="wrapped-text-editor">
                     <Default>
                        <Command idref="mimer.getSchemaObjectRemark">
                           <Input name="object_type" value="COLLATION"/>
                        </Command>
                     </Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[comment on collation "${schema}"."${objectname}" is '${comment}']]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Comment for collation <b>${schema}.${objectname}</b> updated.]]>
                  </Result>
               </Action>
            </Else>

            <Action id="mimer-collation-drop" label="Drop Collation" reload="true" icon="remove">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Collation" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Drop Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[drop collation "${schema}"."${objectname}" ${option}]]></SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all dependent objects that use the collation, such as tables or views' : ''"/>
               <Confirm>
                  <![CDATA[Really drop collation <b>${schema}.${objectname}</b>${_cascadeText}?]]>
               </Confirm>
               <Result>
                  <![CDATA[Collation <b>${schema}.${objectname}</b> dropped with <b>${option}</b> option.]]>
               </Result>
            </Action>
         </ActionGroup>
      </Else>

      <ActionGroup type="Statements">
         <If test="#dm.getDatabaseProductName().equals('Mimer SQL Mobile') or #dm.getDatabaseProductName().equals('Mimer SQL Micro')">
         </If>
         <Else>
            <ActionGroup label="Script: Create Statement">
               <Action id="mimer-call-createstatement" label="Call" resultaction="mergeasscript" resulttarget="editor">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" name="statement" style="text"/>
                  <Input label="Procedure" name="procedure" style="list">
                     <Values>
                        <Command>
                           <SQL>
                              <![CDATA[
select ROUTINE_NAME
from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_SCHEMA = '${schema}'
and ROUTINE_TYPE = 'PROCEDURE'
                ]]>
                           </SQL>
                        </Command>
                     </Values>
                     <Default>${0}</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[
select 'create no scroll statement "${schema}"."${statement}"' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    call "${schema}"."${procedure}"(' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    :' || lower(PARAMETER_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.PARAMETERS P, INFORMATION_SCHEMA.ROUTINES R
where R.ROUTINE_SCHEMA = '${schema}'
and R.ROUTINE_NAME = '${procedure}'
and R.ROUTINE_TYPE = 'PROCEDURE'
and R.SPECIFIC_SCHEMA = P.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = P.SPECIFIC_NAME
and ORDINAL_POSITION = 1
union all
select '   ,:' || lower(PARAMETER_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.PARAMETERS P, INFORMATION_SCHEMA.ROUTINES R
where R.ROUTINE_SCHEMA = '${schema}'
and R.ROUTINE_NAME = '${procedure}'
and R.ROUTINE_TYPE = 'PROCEDURE'
and R.SPECIFIC_SCHEMA = P.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = P.SPECIFIC_NAME
and ORDINAL_POSITION > 1
union all
select '    )' from INFORMATION_SCHEMA.EXT_ONEROW
              ]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Source for statement <b>${schema}.${statement}</b> created.]]>
                  </Result>
               </Action>

               <Action id="mimer-delete-createstatement" label="Delete" icon="deleteWhere" resultaction="mergeasscript" resulttarget="editor">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" name="statement" style="text"/>
                  <Input label="Table" name="table" style="list">
                     <Values>
                        <Command idref="mimer.getTableByType">
                           <Input name="table_type" value="'BASE TABLE','VIEW'"/>
                        </Command>
                     </Values>
                     <Default>${0}</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[
select 'create no scroll statement "${schema}"."${statement}"' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    delete from "${schema}"."${table}" where "' || COLUMN_NAME || '" = :' || lower(COLUMN_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      and "' || COLUMN_NAME || '" = :' || lower(COLUMN_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
              ]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Source for statement <b>${schema}.${statement}</b> created.]]>
                  </Result>
               </Action>

               <Action id="mimer-insert-createstatement" label="Insert" icon="insertRow" resultaction="mergeasscript" resulttarget="editor">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" name="statement" style="text"/>
                  <Input label="Table" name="table" style="list">
                     <Values>
                        <Command idref="mimer.getTableByType">
                           <Input name="table_type" value="'BASE TABLE','VIEW'"/>
                        </Command>
                     </Values>
                     <Default>${0}</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[
select 'create no scroll statement "${schema}"."${statement}"' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    insert into "${schema}"."${table}"("' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      ,"' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
union all
select '    ) values (:' || lower(COLUMN_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      , :' || lower(COLUMN_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
union all
select '    )' from INFORMATION_SCHEMA.EXT_ONEROW
              ]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Source for statement <b>${schema}.${statement}</b> created.]]>
                  </Result>
               </Action>

               <Action id="mimer-select-createstatement" label="Select" icon="selectFrom" resultaction="mergeasscript" resulttarget="editor">
                  <Input label="Scroll option" name="scroll" style="radio">
                     <Values>NO SCROLL|SCROLL|BOTH</Values>
                     <Default>${0}</Default>
                  </Input>
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" name="statement" style="text"/>
                  <Input label="Table" name="table" style="list">
                     <Values>
                        <Command idref="mimer.getTableByType">
                           <Input name="table_type" value="'BASE TABLE','VIEW'"/>
                        </Command>
                     </Values>
                     <Default>${0}</Default>
                  </Input>
                  <SetVar name="_scroll" value="#scroll.equals('BOTH') ? '' : #scroll"/>
                  <Command>
                     <SQL>
                        <![CDATA[
select 'create ${_scroll} statement "${schema}"."${statement}"' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    select "' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      ,"' || COLUMN_NAME || '"'
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
union all
select '    from "${schema}"."${table}"' from INFORMATION_SCHEMA.EXT_ONEROW
              ]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Source for statement <b>${schema}.${statement}</b> created.]]>
                  </Result>
               </Action>

               <Action id="mimer-set-createstatement" label="Set" resultaction="mergeasscript" resulttarget="editor">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" name="statement" style="text"/>
                  <Input label="Function" name="procedure" style="list">
                     <Values>
                        <Command>
                           <SQL>
                              <![CDATA[
select ROUTINE_NAME
from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_SCHEMA = '${schema}'
and ROUTINE_TYPE = 'FUNCTION'
                ]]>
                           </SQL>
                        </Command>
                     </Values>
                     <Default>${0}</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[
select 'create no scroll statement "${schema}"."${statement}"' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    set ? = "${schema}"."${procedure}"(' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '    :' || lower(PARAMETER_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.PARAMETERS P, INFORMATION_SCHEMA.ROUTINES R
where R.ROUTINE_SCHEMA = '${schema}'
and R.ROUTINE_NAME = '${procedure}'
and R.ROUTINE_TYPE = 'FUNCTION'
and R.SPECIFIC_SCHEMA = P.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = P.SPECIFIC_NAME
and ORDINAL_POSITION = 1
union all
select '   ,:' || lower(PARAMETER_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.PARAMETERS P, INFORMATION_SCHEMA.ROUTINES R
where R.ROUTINE_SCHEMA = '${schema}'
and R.ROUTINE_NAME = '${procedure}'
and R.ROUTINE_TYPE = 'FUNCTION'
and R.SPECIFIC_SCHEMA = P.SPECIFIC_SCHEMA
and R.SPECIFIC_NAME = P.SPECIFIC_NAME
and ORDINAL_POSITION > 1
union all
select '    )' from INFORMATION_SCHEMA.EXT_ONEROW
              ]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Source for statement <b>${schema}.${statement}</b> created.]]>
                  </Result>
               </Action>

               <Action id="mimer-update-createstatement" label="Update" icon="updateRow" resultaction="mergeasscript" resulttarget="editor">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" name="statement" style="text"/>
                  <Input label="Table" name="table" style="list">
                     <Values>
                        <Command idref="mimer.getTableByType">
                           <Input name="table_type" value="'BASE TABLE','VIEW'"/>
                        </Command>
                     </Values>
                     <Default>${0}</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[
select 'create no scroll statement "${schema}"."${statement}"' from INFORMATION_SCHEMA.EXT_ONEROW
union all
select '     update "${schema}"."${table}" set "' || COLUMN_NAME || '" = :' || lower(COLUMN_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      , "' || COLUMN_NAME || '" = :' || lower(COLUMN_NAME) || ':ind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
union all
select '     where "' || COLUMN_NAME || '" = :r' || lower(COLUMN_NAME) || ':rind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION = 1
union all
select '      and "' || COLUMN_NAME || '" = :r' || lower(COLUMN_NAME) || ':rind' || cast(ORDINAL_POSITION as varchar(10))
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = '${schema}'
and TABLE_NAME = '${table}'
and ORDINAL_POSITION > 1
              ]]>
                     </SQL>
                  </Command>
                  <Result>
                     <![CDATA[Source for statement <b>${schema}.${statement}</b> created.]]>
                  </Result>
               </Action>
            </ActionGroup>
         </Else>
      </ActionGroup>

      <ActionGroup type="Statement">
         <If test="#dm.getDatabaseProductName().equals('Mimer SQL Mobile') or #dm.getDatabaseProductName().equals('Mimer SQL Micro')">
         </If>
         <Else>
            <If test="#util.isDatabaseVersionLTE(9,2)">
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <Action id="mimer-statement-comment" label="Comment Statement" icon="commentEdit" reload="true">
                  <Input label="Schema" style="text" editable="false">
                     <Default>${schema}</Default>
                  </Input>
                  <Input label="Statement" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Comment" name="comment" style="wrapped-text-editor">
                     <Default>
                        <Command idref="mimer.getSchemaObjectRemark">
                           <Input name="object_type" value="STATEMENT"/>
                        </Command>
                     </Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[comment on statement "${schema}"."${objectname}" is '${comment}']]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Comment for statement <b>${schema}.${objectname}</b> updated.]]>
                  </Result>
               </Action>
            </Else>

            <Action id="mimer-statement-drop" label="Drop Statement" reload="true" icon="remove">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Statement" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[drop statement "${schema}"."${objectname}"]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really drop statement <b>${schema}.${objectname}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[Statement <b>${schema}.${objectname}</b> dropped.]]>
               </Result>
            </Action>
         </Else>

         <If test="#util.isDatabaseVersionLTE(9,2)">
            <!-- Version 9.2 or earlier -->
            <Action id="mimer-statement-execute92" label="Execute Statement" icon="executeCurrent">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Statement" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command processmarkers="withdriver">
                  <SQL>
                     <![CDATA[execute statement "${schema}"."${objectname}"]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really execute statement <b>${schema}.${objectname}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[Statement <b>${schema}.${objectname}</b> executed.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-statement-execute" label="Execute Statement" icon="executeCurrent">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Statement" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command processmarkers="withdriver">
                  <SQL><![CDATA["${schema}"."${objectname}"]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really execute statement <b>${schema}.${objectname}</b>?]]>
               </Confirm>
               <Result>
                  <![CDATA[Statement <b>${schema}.${objectname}</b> executed.]]>
               </Result>
            </Action>
         </Else>

         <If test="#dm.getDatabaseProductName().equals('Mimer SQL Mobile') or #dm.getDatabaseProductName().equals('Mimer SQL Micro')">
         </If>
         <Else>
            <Action id="mimer-statement-grant" label="Grant Execute" icon="grant" reload="true">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Statement" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Grantee" name="grantee" editable="true" style="list">
                  <Values>
                     <Command idref="mimer.getGrantees">
                        <Input name="exclude_ident" value=""/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Grant Option" name="option" style="check">
                  <Values>WITH GRANT OPTION</Values>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[grant execute 
on statement "${schema}"."${objectname}" 
to "${grantee}" ${option}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Execute privilege on statement <b>${schema}.${objectname}</b> granted to <b>${grantee}</b>.]]>
               </Result>
            </Action>

            <Action id="mimer-statement-refresh" label="Refresh Statement" icon="compile">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Statement" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter statement "${schema}"."${objectname}" refresh]]></SQL>
               </Command>
               <Result>
                  <![CDATA[Statement <b>${schema}.${objectname}</b> refreshed.]]>
               </Result>
            </Action>

            <Action id="mimer-statement-revoke" label="Revoke Execute" icon="revoke" reload="true">
               <Input label="Grant Option" name="grantOption" style="check">
                  <Values>GRANT OPTION for</Values>
               </Input>
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Statement" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Grantee" name="ident" style="list">
                  <Values>
                     <Command idref="mimer.getGranteeForSchemaObjectPrivileges">
                        <Input name="object_type" value="STATEMENT"/>
                        <Input name="privilege_type" value="EXECUTE"/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <Input label="Revoke Option" name="option" style="radio">
                  <Labels>RESTRICT|CASCADE</Labels>
                  <Values>restrict|cascade</Values>
                  <Default>RESTRICT</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[revoke ${grantOption} execute 
on statement "${schema}"."${objectname}" 
from "${ident}" ${option}]]>
                  </SQL>
               </Command>
               <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${ident}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
               <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
               <Confirm>
                  <![CDATA[Really revoke ${_grantOptionText}execute privilege on statement <b>${schema}.${objectname}</b> from <b>${ident}</b>${_cascadeText}]]>
               </Confirm>
               <SetVar name="_execute" value="#grantOption.equals('') ? 'Execute' : 'execute'"/>
               <Result>
                  <![CDATA[${_grantOptionText}${_execute} privilege on statement <b>${schema}.${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
               </Result>
            </Action>
         </Else>
      </ActionGroup>

      <ActionGroup type="Properties">
         <Action id="mimer-properties-enter" label="Enter Program" reload="true">
            <Input label="Program" name="program" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
select IDENT_NAME
from INFORMATION_SCHEMA.EXT_IDENTS
where IDENT_TYPE = 'PROGRAM'
                ]]>
                     </SQL>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Password" name="password" style="password"/>
            <Command>
               <SQL><![CDATA[enter '${program}' using '${password}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Program <b>${program}</b> entered.]]>
            </Result>
         </Action>

         <Action id="mimer-properties-leave" label="Leave Program" reload="true">
            <Input label="Program" style="text" editable="false">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select CURRENT_PROGRAM() from INFORMATION_SCHEMA.EXT_ONEROW]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Confirm>
               Leave entered program?
            </Confirm>
            <Command>
               <SQL><![CDATA[leave]]></SQL>
            </Command>
            <Result>
               <![CDATA[Leave program performed.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="DBA">
         <If test="#util.isDatabaseVersionLTE(9,2)">
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-database-alter" label="Alter Database">
               <Input label="Auto Upgrade" name="operation" style="radio">
                  <Values>Set|Drop</Values>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[
select case when ATTRIBUTE_VALUE = 'YES' then 'Drop' else 'Set' end
from SYSTEM.SERVER_INFO
where SERVER_ATTRIBUTE = 'AUTOUPGRADE_ENABLED'
                    ]]>
                        </SQL>
                     </Command>
                  </Default>
               </Input>
               <SetVar name="_operation" value="#operation.equals('Set') ? 'set' : 'drop'"/>
               <Command>
                  <SQL>
                     <![CDATA[alter database ${_operation} autoupgrade]]>
                  </SQL>
               </Command>
            </Action>
         </Else>

         <Action id="mimer-error-find" label="Find Error Code">
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <Input label="Message Text like pattern (lower case)" name="likepattern" style="text">
                  <Default>%text%</Default>
               </Input>
               <SetVar name="_likecondition" value="#likepattern.equals('') ? '' : 'lower(MESSAGE) like \'${likepattern}\'\nand '"/>
            </If>
            <Else>
               <If test="#util.isDatabaseVersionGTE(11)">
                  <!-- Version 11.0 or later -->
                  <Input label="Message text like pattern" name="likepattern" style="text">
                     <Default>%text%</Default>
                  </Input>
                  <SetVar name="_likecondition" value="#likepattern.equals('') ? '' : 'where MESSAGE_TEXT like \'${likepattern}\''"/>
               </If>
               <Else>
                  <!-- Version 9.3 or later -->
                  <Input label="Message Text like pattern" name="likepattern" style="text">
                     <Default>%text%</Default>
                  </Input>
                  <SetVar name="_likecondition" value="#likepattern.equals('') ? '' : 'lower(MESSAGE) like lower(\'${likepattern}\')\nand '"/>
               </Else>
            </Else>
            <Command>
               <SQL>
                  <If test="#util.isDatabaseVersionGTE(11)">
                  <![CDATA[
select NATIVE_ERROR,MODULE_NAME,SEVERITY,MESSAGE_TEXT from INFORMATION_SCHEMA.EXT_MESSAGES 
${_likecondition}]]>
                  </If>
                  <Else>
                  <![CDATA[
select MESSAGEID,LINENO,MESSAGE from SYSTEM.MESSAGE 
where ${_likecondition}MODULEID = 1
and "LANGUAGE" = 1]]>
                  </Else>
               </SQL>
            </Command>
         </Action>

         <Action id="mimer-database-set" label="Set Database">
            <Input label="State" name="state" style="list">
               <Values>OFFLINE|ONLINE RESET LOG|ONLINE PRESERVE LOG</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select trim(trailing from case when IS_ONLINE = 'YES' then 'OFFLINE' else 'ONLINE PRESERVE LOG' end)
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = 'LOGDB'
                 ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[set database ${state}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Really set database state to <b>${state}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Database state set to <b>${state}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-error-show" label="Show Error Text">
            <Input label="Error number" name="errcode" style="number"/>
            <If test="#util.isDatabaseVersionGTE(11)">
               <SetVar name="_errcode" value="#errcode.equals('') ? '' : 'where NATIVE_ERROR = ${errcode}'"/>
            </If>
            <Else>
               <SetVar name="_errcode" value="#errcode.equals('') ? '' : 'MESSAGEID = ${errcode}\nand '"/>
            </Else>
            <Command>
               <SQL>
                 <If test="#util.isDatabaseVersionGTE(11)">
                  <![CDATA[
select NATIVE_ERROR,MODULE_NAME,SEVERITY,MESSAGE_TEXT from INFORMATION_SCHEMA.EXT_MESSAGES 
${_errcode}]]>
                  </If>
                  <Else>
                  <![CDATA[
select MESSAGEID,LINENO,MESSAGE from SYSTEM.MESSAGE 
where ${_errcode}MODULEID = 1
and "LANGUAGE" = 1]]>
                  </Else>
               </SQL>
            </Command>
         </Action>

         <Action id="mimer-database-statistics" label="Update Statistics" icon="UpdateStatistics">
            <Command>
               <SQL><![CDATA[update statistics]]></SQL>
            </Command>
            <Confirm>
               Updating statistics for all tables may take some time if the
               database is large. Continue anyway?
            </Confirm>
            <Result>
               <![CDATA[Statistics for entire database updated.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Users">
         <If test="#util.isDatabaseVersionGTE(10,1)">
            <Action id="mimer-user-create101" label="Create User" reload="true" icon="add">
               <Input label="User" name="userName" style="text"/>
               <Input label="Password" name="password" style="password"/>
               <Input label="Schema option" name="with" style="list">
                  <Values>WITH|WITHOUT</Values>
                  <Default>WITH</Default>
               </Input>
               <SetVar name="_usingText" value="#password.equals('') ? '' : ' using \''"/>
               <SetVar name="_pwText" value="#password.equals('') ? '' : #password"/>
               <SetVar name="_usingTrail" value="#password.equals('') ? '' : '\''"/>
               <Command>
                  <SQL><![CDATA[create ident ${userName} as user ${_usingText}${_pwText}${_usingTrail} ${with} schema]]></SQL>
               </Command>
               <Result>
                  <![CDATA[User <b>${userName}</b> created.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <Action id="mimer-user-create" label="Create User" reload="true" icon="add">
               <Input label="User" name="userName" style="text"/>
               <Input label="Password" name="password" style="password"/>
               <Input label="User Type" name="identtype" style="list">
                  <Values>USER|OS_USER</Values>
                  <Default>USER</Default>
               </Input>
               <Input label="Schema option" name="with" style="list">
                  <Values>WITH|WITHOUT</Values>
                  <Default>WITH</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[create ident ${userName} as ${identtype} using '${password}' ${with} schema]]></SQL>
               </Command>
               <Result>
                  <![CDATA[User <b>${userName}</b> created.]]>
               </Result>
            </Action>
         </Else>
      </ActionGroup>

      <ActionGroup type="User">
      <If test="#util.isDatabaseVersionGTE(10,1)">
        <Action id="mimer-user-addosuser" label="Add Login Authorization" reload="true">
          <Input label="User" style="text" editable="false">
            <Default>${objectname}</Default>
          </Input>
          <Input label="Authorization Type" name="authtype" editable="false" style="text">
            <Default>OS_USER</Default>
          </Input>
<!-- Currently only one type! More to come.
         <Input label="Authorization Type" name="authtype" editable="true" style="list">
            <Values>OS_USER</Values>
            <Default>OS_USER</Default>
          </Input> -->
          <Input label="OS user" name="osuser" style="text"/>
          <Command>
            <SQL><![CDATA[alter ident "${objectname}" add ${authtype} '${osuser}']]></SQL>
          </Command>
          <Result>
            <![CDATA[Login via authorization ${authtype} with ${osuser} for ident <b>${objectname}</b> added.]]>
          </Result>
        </Action>
      </If>
      <Else>
         <Action id="mimer-user-alterpassword" label="Alter Password" icon="Password">
            <Input label="User" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Password" name="password" style="password"/>
            <Command>
               <SQL>
                  <![CDATA[alter ident "${objectname}" using '${password}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Password for user <b>${objectname}</b> updated.]]>
            </Result>
         </Action>
      </Else>

         <Action id="mimer-user-comment" label="Comment User" icon="commentEdit" reload="true">
            <Input label="User" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getObjectRemark">
                     <Input name="object_type" value="IDENT"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on ident "${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for user <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <If test="#util.isDatabaseVersionGTE(10,1)">
            <Action id="mimer-user-droposuser" label="Drop Login Authorization" reload="true">
               <Input label="User" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Authorization Type" name="authtype" style="list">
                  <Values>OS_USER|PASSWORD</Values>
                  <Default>OS_USER</Default>
               </Input>
               <Input label="OS user" name="osuser" style="list">
                   <Values>
                     <Command idref="mimer.getOsUsersForIdent"/>
                  </Values>
                  <Default>{0}</Default>
               </Input>
               <SetVar name="_osuser" value="#authtype.equals('PASSWORD') ? '' : '\'' + #osuser + '\'' "/>
               <Command>
                  <SQL><![CDATA[alter ident "${objectname}" drop ${authtype} ${_osuser}]]></SQL>
               </Command>
               <SetVar name="_via" value="#authtype.equals('PASSWORD') ? '' : ' via ' + #osuser"/>
               <Result>
                  <![CDATA[Login via authorization ${authtype} ${_via} for ident <b>${objectname}</b> dropped.]]>
               </Result>
            </Action>
         </If>

         <Action id="mimer-user-drop" label="Drop User" reload="true" icon="remove">
            <Input label="User" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop ident "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects created by the user and other objects dependent on these' : ''"/>
            <Confirm>
               <![CDATA[Really drop user <b>${objectname}${_cascadeText}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[User <b>${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-user-systemgrant" label="Grant System Privilege" icon="grant" reload="true">
            <Input label="Privilege" name="privilege" style="list">
               <Values>BACKUP|DATABANK|IDENT|SCHEMA|SHADOW|STATISTICS</Values>
               <Default>DATABANK</Default>
            </Input>
            <Input label="User" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${privilege} to "${objectname}" ${option}]]></SQL>
            </Command>
            <Result>
               <![CDATA[System privilege <b>${privilege}</b> granted to <b>${objectname}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-user-systemrevoke" label="Revoke System Privilege" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Privilege" name="privilege" style="list">
               <Values>
                  <Command idref="mimer.getSystemPrivilegesToRevoke"/>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="User" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <SetVar name="_grantOption" value="#grantOption.equals('') ? '' : #grantOption + ' '"/>
            <Command>
               <SQL>
                  <![CDATA[revoke ${_grantOption}${privilege} from "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${objectname}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${privilege}</b> privilege from <b>${objectname}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_system" value="#grantOption.equals('') ? 'System' : 'system'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_system} privilege <b>${privilege}</b> revoked from <b>${objectname}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-script-createuser" label="Script: Create Ident" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="User" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getIdentSource">
               <Input name="ident" value="${objectname}"/>
            </Command>
         </Action>

         <If test="#util.isDatabaseVersionGTE(10,1)">
            <Action id="mimer-user-setpassword" label="Set Password" icon="Password" reload="true">
               <Input label="User" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="New Password" name="password" style="password"/>
               <Command>
                  <SQL><![CDATA[alter ident "${objectname}" set password '${password}']]></SQL>
               </Command>
               <Result>
                  <![CDATA[Password for user <b>${objectname}</b> added/updated.]]>
               </Result>
            </Action>
         </If>
         
      </ActionGroup>

      <ActionGroup type="Programs">
         <Action id="mimer-program-create" label="Create Program" reload="true" icon="add">
            <Input label="Program" name="programName" style="text"/>
            <Input label="Password" name="password" style="password"/>
            <Input label="Schema option" name="with" style="list">
               <Values>WITH|WITHOUT</Values>
               <Default>WITH</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[create ident ${programName} as program using '${password}' ${with} schema]]></SQL>
            </Command>
            <Result>
               <![CDATA[Program <b>${programName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Program">
         <Action id="mimer-program-alterpassword" label="Alter Password" icon="Password">
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Password" name="password" style="password"/>
            <Command>
               <SQL>
                  <![CDATA[alter ident "${objectname}" using '${password}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Password for program <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-program-comment" label="Comment Program" icon="commentEdit" reload="true">
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getObjectRemark">
                     <Input name="object_type" value="IDENT"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on ident "${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for program <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-program-drop" label="Drop Program" reload="true" icon="remove">
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop ident "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects created by the program and other objects dependent on these' : ''"/>
            <Confirm>
               <![CDATA[Really drop program <b>${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Program <b>${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-program-enter" label="Enter Program" reload="true">
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Password" name="password" style="password"/>
            <Command>
               <SQL><![CDATA[enter '${objectname}' using '${password}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Program <b>${objectname}</b> entered.]]>
            </Result>
         </Action>

         <Action id="mimer-execute-grant" label="Grant Execute" icon="grant" reload="true">
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value="${objectname}"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant execute on program "${objectname}" to "${grantee}" ${option}]]></SQL>
            </Command>
            <Result>
               <![CDATA[Execute on program <b>${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-program-systemgrant" label="Grant System Privilege" icon="grant" reload="true">
            <Input label="Privilege" name="privilege" style="list">
               <Values>BACKUP|DATABANK|IDENT|SCHEMA|SHADOW|STATISTICS</Values>
               <Default>DATABANK</Default>
            </Input>
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${privilege} to "${objectname}" ${option}]]></SQL>
            </Command>
            <Result>
               <![CDATA[System privilege <b>${privilege}</b> granted to <b>${objectname}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-program-leave" label="Leave Program" reload="true">
            <Input label="Program" style="text" editable="false">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select CURRENT_PROGRAM() from INFORMATION_SCHEMA.EXT_ONEROW]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Confirm>
               Leave entered program?
            </Confirm>
            <Command>
               <SQL><![CDATA[leave]]></SQL>
            </Command>
            <Result>
               <![CDATA[Leave program performed.]]>
            </Result>
         </Action>

         <Action id="mimer-program-revoke" label="Revoke Execute" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForObjectPrivileges">
                     <Input name="object_type" value="IDENT"/>
                     <Input name="privilege_type" value="EXECUTE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} execute on program ${objectname} from "${ident}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${ident}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}execute privilege on <b>${objectname}</b> from <b>${ident}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_execute" value="#grantOption.equals('') ? 'Execute' : 'execute'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_execute} on program <b>${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-program-systemrevoke" label="Revoke System Privilege" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Privilege" name="privilege" style="list">
               <Values>
                  <Command idref="mimer.getSystemPrivilegesToRevoke"/>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <SetVar name="_grantOption" value="#grantOption.equals('') ? '' : #grantOption + ' '"/>
            <Command>
               <SQL>
                  <![CDATA[revoke ${_grantOption}${privilege} from "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${objectname}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${privilege}</b> privilege from <b>${objectname}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_system" value="#grantOption.equals('') ? 'System' : 'system'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_system} privilege <b>${privilege}</b> revoked from <b>${objectname}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-script-createprogram" label="Script: Create Ident" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="Program" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getIdentSource">
               <Input name="ident" value="${objectname}"/>
            </Command>
         </Action>

      </ActionGroup>

      <ActionGroup type="Groups">
         <Action id="mimer-group-create" label="Create Group" reload="true" icon="add">
            <Input label="Group" name="groupName" style="text"/>
            <Command>
               <SQL><![CDATA[create ident "${groupName}" as group]]></SQL>
            </Command>
            <Result>
               <![CDATA[Group <b>${groupName}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Group">
         <Action id="mimer-group-comment" label="Comment Group" icon="commentEdit" reload="true">
            <Input label="Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getObjectRemark">
                     <Input name="object_type" value="IDENT"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on ident "${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for group <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-group-drop" label="Drop Group" reload="true" icon="remove">
            <Input label="Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop ident "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that are dependent on the privileges issued to the group' : ''"/>
            <Confirm>
               <![CDATA[Really drop group <b>${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Group <b>${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-group-grant" label="Grant Membership" icon="grant" reload="true">
            <Input label="Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Member" name="grantee" editable="true" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value="${objectname}"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant member on group "${objectname}" to "${grantee}" ${option}]]></SQL>
            </Command>
            <Result>
               <![CDATA[Membership in group <b>${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-group-systemgrant" label="Grant System Privilege" icon="grant" reload="true">
            <Input label="Privilege" name="privilege" style="list">
               <Values>BACKUP|DATABANK|IDENT|SCHEMA|SHADOW|STATISTICS</Values>
               <Default>DATABANK</Default>
            </Input>
            <Input label="Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${privilege} to "${objectname}" ${option}]]></SQL>
            </Command>
            <Result>
               <![CDATA[System privilege <b>${privilege}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-member-revoke" label="Revoke Membership" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Privilege" name="privilege" editable="false" style="text">
               <Default>member</Default>
            </Input>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForObjectPrivileges">
                     <Input name="object_type" value="IDENT"/>
                     <Input name="privilege_type" value="MEMBER"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} ${privilege} on group "${objectname}" from "${ident}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects that are dependent on the privileges from the membership' : ''"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}membership in group <b>${objectname}</b> from <b>${ident}</b>?]]>
            </Confirm>
            <SetVar name="_membership" value="#grantOption.equals('') ? 'Membership' : 'membership'"/>
            <Result>
               <![CDATA[${_grantOptionText}${_membership} in group <b>${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-group-systemrevoke" label="Revoke System Privilege" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <Input label="Privilege" name="privilege" style="list">
               <Values>
                  <Command idref="mimer.getSystemPrivilegesToRevoke"/>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <SetVar name="_grantOption" value="#grantOption.equals('') ? '' : #grantOption + ' '"/>
            <Command>
               <SQL>
                  <![CDATA[revoke ${_grantOption}${privilege} from "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${objectname}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${privilege}</b> privilege from <b>${objectname}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_system" value="#grantOption.equals('') ? 'System' : 'system'"/>
            <Result>
               <![CDATA[${_grantOptionText}${system} privilege <b>${privilege}</b> revoked from <b>${objectname}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-script-creategroup" label="Script: Create Ident" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getIdentSource">
               <Input name="ident" value="${objectname}"/>
            </Command>
         </Action>

      </ActionGroup>

      <ActionGroup type="Databanks">
         <If test="#util.isDatabaseVersionLTE(9,2)">
            <!-- Version 9.2 or earlier -->
            <Action id="mimer-databank-create92" label="Create Databank" reload="true" icon="add">
               <Input label="Databank" name="databankName" style="text"/>
               <Input label="Filename" name="filename" style="text"/>
               <Input label="Filesize (2K pages)" name="filesize" style="number">
                  <Default>1000</Default>
               </Input>
               <Input label="Option" name="option" style="list">
                  <Values>NULL|TRANS|LOG</Values>
                  <Default>TRANS</Default>
               </Input>
               <SetVar name="_filesize" value="#filesize.equals('') ? '' : ' of ' + #filesize + ' pages'"/>
               <SetVar name="_filename" value="#filename.equals('') ? '' : ' in \'' + #filename + '\''"/>
               <Command>
                  <SQL>
                     <![CDATA[create databank "${databankName}"${_filesize}${_filename} with ${option} option]]></SQL>
               </Command>
               <Result>
                  <![CDATA[Databank <b>${databankName}</b> created.]]>
               </Result>
            </Action>
         </If>
         <Else>
            <!-- Version 9.3 or later -->
            <Action id="mimer-databank-create" label="Create Databank" reload="true" icon="add">
               <Input label="Databank" name="databankName" style="text"/>
               <Input label="Filename" name="filename" style="text"/>
               <Input label="Filesize" name="filesize" style="number" linebreak="false">
                  <Default>2000</Default>
               </Input>
               <Input label="Unit" name="unitfilesize" style="list" linebreak="true">
                  <Values>K|M|G</Values>
                  <Default>K</Default>
               </Input>
               <Input label="Minsize" name="minsize" style="number" linebreak="false">
                  <Default/>
               </Input>
               <Input label="Unit" name="unitminsize" style="list" linebreak="true">
                  <Values>K|M|G</Values>
                  <Default>K</Default>
               </Input>
               <Input label="Goalsize" name="goalsize" style="number" linebreak="false">
                  <Default/>
               </Input>
               <Input label="Unit" name="unitgoalsize" style="list" linebreak="true">
                  <Values>K|M|G</Values>
                  <Default>K</Default>
               </Input>
               <Input label="Maxsize" name="maxsize" style="number" linebreak="false">
                  <Default/>
               </Input>
               <Input label="Unit" name="unitmaxsize" style="list" linebreak="true">
                  <Values>K|M|G</Values>
                  <Default>K</Default>
               </Input>
               <Input label="Option" name="option" style="list">
                  <Values>WORK|TRANSACTION|LOG</Values>
                  <Default>TRANSACTION</Default>
               </Input>
               <Input label="Removable" name="removable" style="check">
                  <Values>REMOVABLE</Values>
               </Input>

               <SetVar name="_filename" value="#filename.equals('') ? #databankName : #filename"/>
               <SetVar name="_filesize" value="#filesize.equals('') ? '' : '\n    filesize ' + #filesize + ' ' + #unitfilesize + ','"/>
               <SetVar name="_minsize" value="#minsize.equals('') ? '' : '\n    minsize ' + #minsize + ' ' + #unitminsize + ','"/>
               <SetVar name="_goalsize" value="#goalsize.equals('') ? '' : '\n    goalsize ' + #goalsize + ' ' + #unitgoalsize + ','"/>
               <SetVar name="_maxsize" value="#maxsize.equals('') ? '' : '\n    maxsize ' + #maxsize + ' ' + #unitmaxsize + ','"/>
               <SetVar name="_removable" value="#removable.equals('') ? '' : '\n    removable,'"/>

               <Command>
                  <SQL>
                     <![CDATA[create databank "${databankName}" 
set file '${_filename}',${_filesize}${_minsize}${_goalsize}${_maxsize}${_removable} 
    option ${option}]]>
                  </SQL>
               </Command>
               <Result>
                  <![CDATA[Databank <b>${databankName}</b> created in file <b>${filename}</b>.]]>
               </Result>
            </Action>
         </Else>

         <Action id="mimer-databank-backupscript" label="Create Backup Script" resultaction="mergeasscript" resulttarget="editor">
            <Input label="Backup directory" name="directory" style="text"/>
            <Input label="Filename suffix" name="extension" style="text">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select '_' || substring(cast(current_date as varchar(16)) from 11 for 2) ||
              substring(cast(current_date as varchar(16)) from 14  for 2) || '.dbf'
from INFORMATION_SCHEMA.EXT_ONEROW
                ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[
select 'start backup;' as "Backup Script" from INFORMATION_SCHEMA.EXT_ONEROW
union all
select 'create backup in ''${directory}' ||
       case when DATABANK_NAME = 'SYSDB'
       then substring(lower(FILE_NAME) from 1 for position('.' in FILE_NAME)-1)
       else lower(DATABANK_NAME) end ||
       '${extension}'' for databank ' || DATABANK_NAME || ';'
       from INFORMATION_SCHEMA.EXT_DATABANKS
union all
select 'commit backup;' from INFORMATION_SCHEMA.EXT_ONEROW
]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Backup script created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Databank">
         <ActionGroup label="Alter Databank">
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <!-- Version 9.2 or earlier -->
               <Action id="mimer-databank-alteraddpages" label="Add Pages" reload="true" icon="Size">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Pages (2K)" name="pages" style="number">
                     <Default>100</Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" add ${pages} pages]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Databank <b>${objectname}</b> extended with <b>${pages}</b> pages.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-alter92filename" label="Filename" icon="rename" reload="true">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" into '${filename}']]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Filename for databank <b>${objectname}</b> set to <b>${filename}</b>.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-alter92option" label="Option" reload="true">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Option" name="option" style="list">
                     <Values>NULL|TRANS|LOG</Values>
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select DATABANK_TYPE
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" to ${option} option]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Option for databank <b>${objectname}</b> set to <b>${option}</b>.]]>
                  </Result>
               </Action>
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <Action id="mimer-databank-alterfilename" label="Filename" icon="rename" reload="true">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" set file '${filename}']]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Filename for databank <b>${objectname}</b> set to <b>${filename}</b>.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-alterfilesize" label="Filesize" reload="true" icon="Size">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Operation" name="operation" style="radio">
                     <Values>Set|Drop (make file as small as possible)</Values>
                     <Default>Set</Default>
                  </Input>
                  <Input label="Size" name="pages" style="number" linebreak="false">
                     <Default>2000</Default>
                  </Input>
                  <Input label="Unit" name="unit" style="list" linebreak="true">
                     <Values>K|M|G</Values>
                     <Default>K</Default>
                  </Input>
                  <SetVar name="_operation" value="#operation.equals('Set') ? 'set filesize ${pages} ${unit}' : 'drop filesize'"/>
                  <SetVar name="_explantion" value="#operation.equals('Set') ? 'set to ${pages}${unit}' : 'dropped'"/>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" ${_operation}]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Filesize for databank <b>${objectname}</b> ${_explanation}.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-altergoalsize" label="Goalsize" reload="true" icon="Goalsize">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Operation" name="operation" style="radio">
                     <Values>Set|Drop</Values>
                     <Default>Set</Default>
                  </Input>
                  <Input label="Goalsize" name="pages" style="number" linebreak="false">
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select GOALSIZE
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <Input label="Unit" name="unit" style="list" linebreak="true">
                     <Values>K|M|G</Values>
                     <Default>K</Default>
                  </Input>
                  <SetVar name="_operation" value="#operation.equals('Set') ? 'set goalsize ${pages} ${unit}' : 'drop goalsize'"/>
                  <SetVar name="_explantion" value="#operation.equals('Set') ? 'set to ${pages}${unit}' : 'dropped'"/>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" ${_operation}]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Goalsize for databank <b>${objectname}</b> ${_explanation}.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-maxsize" label="Maxsize" reload="true" icon="Maxsize">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Operation" name="operation" style="radio">
                     <Values>Set|Drop</Values>
                     <Default>Set</Default>
                  </Input>
                  <Input label="Maxsize" name="pages" style="number" linebreak="false">
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select MAXSIZE
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <Input label="Unit" name="unit" style="list" linebreak="true">
                     <Values>K|M|G</Values>
                     <Default>K</Default>
                  </Input>
                  <SetVar name="_operation" value="#operation.equals('Set') ? 'set maxsize ${pages} ${unit}' : 'drop maxsize'"/>
                  <SetVar name="_explantion" value="#operation.equals('Set') ? 'set to ${pages}${unit}' : 'dropped'"/>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" ${_operation}]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Maxsize for databank <b>${objectname}</b> ${_explanation}.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-alterminsize" label="Minsize" reload="true" icon="Minsize">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Operation" name="operation" style="radio">
                     <Values>Set|Drop</Values>
                     <Default>Set</Default>
                  </Input>
                  <Input label="Minsize" name="pages" style="number" linebreak="false">
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select MINSIZE
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <Input label="Unit" name="unit" style="list" linebreak="true">
                     <Values>K|M|G</Values>
                     <Default>K</Default>
                  </Input>
                  <SetVar name="_operation" value="#operation.equals('Set') ? 'set minsize ${pages} ${unit}' : 'drop minsize'"/>
                  <SetVar name="_explantion" value="#operation.equals('Set') ? 'set to ${pages}${unit}' : 'dropped'"/>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" ${_operation}]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Minsize for databank <b>${objectname}</b> ${_explanation}.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-alteroption" label="Option" reload="true">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Option" name="option" style="list">
                     <Values>WORK|TRANSACTION|LOG</Values>
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select DATABANK_TYPE
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" set option ${option}]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Option for databank <b>${objectname}</b> set to <b>${option}</b>.]]>
                  </Result>
               </Action>

               <Action id="mimer-databank-alterremovable" label="Removable" reload="true" icon="Removable">
                  <Input label="Databank" style="text" editable="false">
                     <Default>${objectname}</Default>
                  </Input>
                  <Input label="Filename" name="filename" style="text" editable="false">
                     <Default>
                        <Command idref="mimer.getDatabankFilename"/>
                     </Default>
                  </Input>
                  <Input label="Operation" name="operation" style="radio">
                     <Values>Set|Drop</Values>
                     <Default>
                        <Command>
                           <SQL>
                              <![CDATA[
select case when IS_REMOVABLE = 'YES' then 'Drop' else 'Set' end
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                    ]]>
                           </SQL>
                        </Command>
                     </Default>
                  </Input>
                  <SetVar name="_operation" value="#operation.equals('Set') ? 'set' : 'drop'"/>
                  <SetVar name="_explantion" value="#operation.equals('Set') ? 'set' : 'dropped'"/>
                  <Command>
                     <SQL>
                        <![CDATA[alter databank "${objectname}" ${_operation} removable]]></SQL>
                  </Command>
                  <Result>
                     <![CDATA[Removable option for databank <b>${objectname}</b> was <b>${_explanation}</b>.]]>
                  </Result>
               </Action>
            </Else>

            <Separator/>

            <Action id="mimer-databank-alterrestorelog" label="Restore From Log" reload="true">
               <Input label="Databank" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Filename" name="filename" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getDatabankFilename"/>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter databank "${objectname}" restore using log]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really restore databank?<br><br>You must have copied the latest backup to <b>'${filename}'</b><br>(this filename is relative to the database home directory).]]>
               </Confirm>
               <Result>
                  <![CDATA[Databank <b>${objectname}</b> restored from log.]]>
               </Result>
            </Action>

            <Action id="mimer-databank-alterrestorefile" label="Restore From File" reload="true">
               <Input label="Databank" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Databank filename" name="filename" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getDatabankFilename"/>
                  </Default>
               </Input>
               <Input label="LOGDB backup filename" name="logdbFilename" style="text"/>
               <Command>
                  <SQL>
                     <![CDATA[alter databank "${objectname}" restore using '${logdbFilename}']]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really restore databank from LOGDB backup?<br><br>You must have copied the correct backup to <b>'${filename}'</b><br>(this filename is relative to the database home directory).]]>
               </Confirm>
               <Result>
                  <![CDATA[Databank <b>${objectname}</b> restored from file <b>${logdbFilename}</b>.]]>
               </Result>
            </Action>
         </ActionGroup>

         <Action id="mimer-databank-comment" label="Comment Databank" icon="commentEdit" reload="true">
            <Input label="Databank" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comment" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command idref="mimer.getObjectRemark">
                     <Input name="object_type" value="DATABANK"/>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on databank "${objectname}" is '${comment}']]></SQL>
            </Command>
            <Result>
               <![CDATA[Comment for databank <b>${objectname}</b> updated.]]>
            </Result>
         </Action>

         <Action id="mimer-databank-shadowcreate" label="Create Shadow" reload="true" icon="add">
            <Input label="Shadow" name="shadowName" style="text"/>
            <Input label="Databank" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Shadow Filename" name="filename" style="text"/>
            <SetVar name="_filename" value="#filename.equals('') ? #shadowName : #filename"/>
            <Command>
               <SQL>
                  <![CDATA[create shadow "${shadowName}" 
for "${objectname}" 
in '${_filename}']]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Shadow <b>${shadowName}</b> for databank <b>${objectname}</b> created.]]>
            </Result>
         </Action>

         <Action id="mimer-databank-drop" label="Drop Databank" reload="true" icon="remove">
            <Input label="Databank" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop databank "${objectname}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and all objects in the databank and other objects dependent on these' : ''"/>
            <Confirm>
               <![CDATA[Really drop databank <b>${objectname}</b>${_cascadeText}?]]>
            </Confirm>
            <Result>
               <![CDATA[Databank <b>${objectname}</b> dropped with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-databank-set" label="Set Databank" reload="true">
            <Input label="Databank" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="State" name="state" style="list">
               <Values>OFFLINE|ONLINE RESET LOG|ONLINE PRESERVE LOG</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select trim(trailing from case when IS_ONLINE = 'YES' then 'OFFLINE' else 'ONLINE PRESERVE LOG' end)
from INFORMATION_SCHEMA.EXT_DATABANKS
where DATABANK_NAME = '${objectname}'
                 ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[set databank "${objectname}" ${state}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Really set databank <b>${objectname}</b> state to <b>${state}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Databank <b>${objectname}</b> set to state <b>${state}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-databank-objectgrant" label="Grant Object Privilege" icon="grant" reload="true">
            <Input label="Databank" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <Input label="Table Privilege" name="privilege" style="list">
                  <Values>TABLE</Values>
                  <Default>TABLE</Default>
               </Input>
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <Input label="Privilege" name="privilege" style="list">
                  <Values>TABLE|SEQUENCE</Values>
                  <Default>TABLE</Default>
               </Input>
            </Else>
            <Input label="Grantee" name="grantee" style="list">
               <Values>
                  <Command idref="mimer.getGrantees">
                     <Input name="exclude_ident" value=""/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Grant Option" name="option" style="check">
               <Values>WITH GRANT OPTION</Values>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${privilege} on databank "${objectname}" to "${grantee}" ${option}]]></SQL>
            </Command>
            <Result>
               <![CDATA[${privilege} privilege on databank <b>${objectname}</b> granted to <b>${grantee}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-databank-objectrevoke" label="Revoke Object Privilege" icon="revoke" reload="true">
            <Input label="Grant Option" name="grantOption" style="check">
               <Values>GRANT OPTION for</Values>
            </Input>
            <If test="#util.isDatabaseVersionLTE(9,2)">
               <Input label="Privilege" name="privilege" style="list">
                  <Values>TABLE</Values>
                  <Default>TABLE</Default>
               </Input>
            </If>
            <Else>
               <!-- Version 9.3 or later -->
               <Input label="Privilege" name="privilege" style="list">
                  <Values>
                     <Command idref="mimer.getPrivilegesForObjectPrivileges">
                        <Input name="object_type" value="DATABANK"/>
                     </Command>
                  </Values>
                  <Default>{0}</Default>
               </Input>
            </Else>
            <Input label="Grantee" name="ident" style="list">
               <Values>
                  <Command idref="mimer.getGranteeForObjectPrivileges">
                     <Input name="object_type" value="DATABANK"/>
                     <Input name="privilege_type" value="TABLE','SEQUENCE"/>
                  </Command>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Revoke Option" name="option" style="radio">
               <Labels>RESTRICT|CASCADE</Labels>
               <Values>restrict|cascade</Values>
               <Default>RESTRICT</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[revoke ${grantOption} ${privilege} on databank "${objectname}" from "${ident}" ${option}]]></SQL>
            </Command>
            <SetVar name="_cascadeText" value="#option.equals('CASCADE') ? '&lt;br>and recursively from idents granted to by ${ident}?&lt;br>&lt;br>No objects are affected by this operation.' : '?'"/>
            <SetVar name="_grantOptionText" value="#grantOption.equals('') ? '' : '&lt;b>GRANT OPTION&lt;/b> for '"/>
            <Confirm>
               <![CDATA[Really revoke ${_grantOptionText}<b>${privilege}</b> privilege on databank <b>${objectname}</b> from <b>${ident}</b>${_cascadeText}]]>
            </Confirm>
            <SetVar name="_table" value="#grantOption.equals('') ? 'Table' : 'table'"/>
            <Result>
               <![CDATA[${_grantOptionText}<b>${_table}</b> privilege on databank <b>${objectname}</b> revoked from <b>${ident}</b> with <b>${option}</b> option.]]>
            </Result>
         </Action>

         <Action id="mimer-script-createdatabank" label="Script: Create Databank" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="Databank" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getDatabankSource">
               <Input name="databank_name" value="${objectname}"/>
            </Command>
         </Action>

      </ActionGroup>

      <ActionGroup type="Shadows">
         <Action id="mimer-shadow-create" label="Create Shadow" reload="true" icon="add">
            <Input label="Shadow" name="shadowName" style="text"/>
            <Input label="Databank" name="databank" style="list">
               <Values column="2">
                  <Command idref="mimer.getDatabanks"/>
               </Values>
               <Default>{0}</Default>
            </Input>
            <Input label="Shadow Filename" name="filename" style="text"/>
            <SetVar name="_filename" value="#filename.equals('') ? #shadowName : #filename"/>
            <Command>
               <SQL>
                  <![CDATA[create shadow "${shadowName}" 
for "${databank}" 
in '${_filename}']]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Shadow <b>${shadowName}</b> for databank <b>${databank}</b> created.]]>
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Shadow">
         <ActionGroup label="Alter Shadow">
            <Action id="mimer-shadow-alteraddpages" label="Add Pages" reload="true" icon="Size">
               <Input label="Databank" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getDatabankForShadow"/>
                  </Default>
               </Input>
               <Input label="Shadow" name="shadowName" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Pages (2K)" name="pages" style="number">
                  <Default>100</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter shadow "${objectname}" add ${pages} pages]]></SQL>
               </Command>
               <Result>
                  <![CDATA[Shadow <b>${objectname}</b> extended with <b>${pages}</b> pages.]]>
               </Result>
            </Action>

            <Action id="mimer-shadow-alterfilename" label="Filename" icon="rename" reload="true">
               <Input label="Databank" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getDatabankForShadow"/>
                  </Default>
               </Input>
               <Input label="Shadow" name="shadowName" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Filename" name="filename" style="text">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[
select FILE_NAME
from INFORMATION_SCHEMA.EXT_SHADOWS
where SHADOW_NAME = '${objectname}'
                    ]]>
                        </SQL>
                     </Command>
                  </Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter shadow "${objectname}" into '${filename}']]></SQL>
               </Command>
               <Result>
                  <![CDATA[Filename for shadow <b>${objectname}</b> set to <b>${filename}</b>.]]>
               </Result>
            </Action>

            <Action id="mimer-shadow-tomaster" label="To Master" reload="true">
               <Input label="Databank" style="text" editable="false">
                  <Default>
                     <Command idref="mimer.getDatabankForShadow"/>
                  </Default>
               </Input>
               <Input label="Shadow" name="shadowName" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL><![CDATA[alter shadow "${objectname}" to master]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really make shadow <b>${objectname}</b> master databank and the current master a shadow?]]>
               </Confirm>
               <Result>
                  <![CDATA[Shadow <b>${objectname}</b> set to master.]]>
               </Result>
            </Action>
         </ActionGroup>

         <Action id="mimer-shadow-drop" label="Drop Shadow" reload="true" icon="remove">
            <Input label="Databank" style="text" editable="false">
               <Default>
                  <Command idref="mimer.getDatabankForShadow"/>
               </Default>
            </Input>
            <Input label="Shadow" name="shadowName" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop shadow "${objectname}"]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Really drop shadow <b>${objectname}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Shadow <b>${objectname}</b> dropped.]]>
            </Result>
         </Action>

         <Action id="mimer-shadow-set" label="Set Shadow" reload="true">
            <Input label="Databank" style="text" editable="false">
               <Default>
                  <Command idref="mimer.getDatabankForShadow"/>
               </Default>
            </Input>
            <Input label="Shadow" name="shadowName" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="State" name="state" style="list">
               <Values>OFFLINE|ONLINE RESET LOG|ONLINE PRESERVE LOG</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[
select trim(trailing from case when IS_ONLINE = 'YES' then 'OFFLINE' else 'ONLINE PRESERVE LOG' end)
from INFORMATION_SCHEMA.EXT_SHADOWS
where SHADOW_NAME = '${objectname}'
                   ]]>
                     </SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[set shadow "${objectname}" ${state}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Really set shadow <b>${objectname}</b> state to <b>${state}</b>?]]>
            </Confirm>
            <Result>
               <![CDATA[Shadow <b>${objectname}</b> set to state <b>${state}</b>.]]>
            </Result>
         </Action>

         <Action id="mimer-script-createshadow" label="Script: Create Shadow" resultaction="mergeasscript" resulttarget="editor" icon="ActionExecute">
            <Input label="Databank" style="text" editable="false">
               <Default>
                  <Command idref="mimer.getDatabankForShadow"/>
               </Default>
            </Input>
            <Input label="Shadow" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command idref="mimer.getShadowSource">
               <Input name="shadow_name" value="${objectname}"/>
            </Command>
         </Action>

      </ActionGroup>

   </ObjectsActionDef>

   <!-- =================================================================== -->
   <!-- Definition of the database objects tree structure                   -->
   <!-- This definition does not list catalogs as these are not used        -->
   <!-- by Mimer SQL at the moment.                                         -->
   <!-- =================================================================== -->

   <ObjectsTreeDef extends="false">
      <If test="#dm.getDatabaseProductName().equals('Mimer SQL Auto')">
         <!--  Mimer SQL Mobile -->
         <GroupNode type="Locks" label="Mimer SQL Auto" isLeaf="true"/>
      </If>
      <Else>
          <If test="#dm.getDatabaseProductName().equals('Mimer SQL Mobile') or #dm.getDatabaseProductName().equals('Mimer SQL Micro')">
             <!--  Mimer SQL Mobile -->
             <GroupNode type="Statements" label="Statements">
                <DataNode type="Statement" label="${mimer.getMobileStatements.STATEMENT_SCHEMA}.${mimer.getMobileStatements.STATEMENT_NAME}" isLeaf="true">
                   <SetVar name="schema" value="${mimer.getMobileStatements.STATEMENT_SCHEMA}"/>
                   <SetVar name="objectname" value="${mimer.getMobileStatements.STATEMENT_SCHEMA}.${mimer.getMobileStatements.STATEMENT_NAME}"/>
                   <Command idref="mimer.getMobileStatements"/>
                </DataNode>
             </GroupNode>
          </If>
          <Else>
             <GroupNode type="Schemas" label="Schemas">
                <DataNode type="Schema" label="${mimer.getSchemas.SCHEMA_NAME}">
                   <SetVar name="schema" value="${mimer.getSchemas.SCHEMA_NAME}"/>
                   <If test="#util.isDatabaseVersionLTE(9,1)">
                      <!-- Version 9.1 or earlier -->
                      <SetVar name="defaultdatatype" value="varchar(20)"/>
                      <SetVar name="defaultvalue" value="'abc'"/>
                      <SetVar name="collateClause" value=""/>
                   </If>
                   <Else>
                      <SetVar name="defaultdatatype" value="nvarchar(20)"/>
                      <SetVar name="defaultvalue" value="n'abc'"/>
                   </Else>
                   <Command idref="mimer.getSchemas">
                      <Filter index="SCHEMA_NAME" label="Name"/>
                   </Command>

                   <GroupNode type="Tables" label="Tables">
                      <DataNode type="Table" label="${mimer.getTables.TABLE_NAME}" isLeaf="false">
                         <SetVar name="objectname" value="${mimer.getTables.TABLE_NAME}"/>
                         <SetVar name="tablename" value="${mimer.getTables.TABLE_NAME}"/>
                         <SetVar name="rowcount" value="true"/>
                         <SetVar name="acceptInQB" value="true"/>
                         <Command idref="mimer.getTables">
                            <Input name="table_schema" value="${schema}"/>
                         </Command>

                         <SetVar name="theTableName" value="${objectname}"/>

                         <GroupNode type="Columns" label="Columns">
                            <DataNode type="Column" label="${getColumnDefinitions.COLUMN_NAME}"
                                      label1="${getColumnDefinitions.TYPE_NAME}"
                                      isLeaf="true"
                                      icon="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'PrimaryKey' : 'Column'"
                                      tip="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'This is a primary key column' : ''">
                               <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                               <SetVar name="columnschema" value="${schema}"/>
                               <Command idref="getColumnDefinitions">
                                  <Input name="schema" value="${schema}"/>
                                  <Input name="objectname" value="${theTableName}"/>
                                  <Input name="tableType" value="Table"/>
                                  <Filter index="TYPE_NAME" label="Type"/>
                               </Command>
                            </DataNode>
                         </GroupNode>

                         <GroupNode type="Constraints" label="Constraints">
                            <DataNode type="Constraint" label="${mimer.getTableConstraints.CONSTRAINT_NAME}">
                               <SetVar name="objectname" value="${mimer.getTableConstraints.CONSTRAINT_NAME}"/>
                               <SetVar name="constraintName" value="${mimer.getTableConstraints.CONSTRAINT_NAME}"/>
                               <Command idref="mimer.getTableConstraints">
                                  <Input name="table_schema" value="${schema}"/>
                                  <Input name="table_name" value="${theTableName}"/>
                               </Command>
                               <DataNode type="Column" label="${mimer.getTableConstraintWithColumn.COLUMN_NAME}" isLeaf="true">
                                  <SetVar name="columnschema" value="${mimer.getTableConstraintWithColumn.TABLE_SCHEMA}"/>
                                  <SetVar name="tablename" value="${mimer.getTableConstraintWithColumn.TABLE_NAME}"/>
                                  <SetVar name="objectname" value="${mimer.getTableConstraintWithColumn.COLUMN_NAME}"/>
                                  <Command idref="mimer.getTableConstraintWithColumn">
                                     <Input name="table_schema" value="${schema}"/>
                                     <Input name="table_name" value="${theTableName}"/>
                                     <Input name="constraint_name" value="${constraintName}"/>
                                  </Command>
                               </DataNode>
                            </DataNode>
                         </GroupNode>

                         <GroupNode type="Indexes" label="Indexes">
                            <DataNode type="Index" label="${mimer.getIndexes.INDEX_NAME}">
                               <SetVar name="objectname" value="${mimer.getIndexes.INDEX_NAME}"/>
                               <SetVar name="indexName" value="${mimer.getIndexes.INDEX_NAME}"/>
                               <Command idref="mimer.getIndexes">
                                  <Input name="index_schema" value="${schema}"/>
                                  <Input name="tableNamePattern" value="${theTableName}"/>
                               </Command>
                               <DataNode type="Column" label="${mimer.getIndexColumns.COLUMN_NAME}" isLeaf="true">
                                  <SetVar name="columnschema" value="${mimer.getIndexColumns.INDEX_SCHEMA}"/>
                                  <SetVar name="objectname" value="${mimer.getIndexColumns.COLUMN_NAME}"/>
                                  <Command idref="mimer.getIndexColumns">
                                     <Input name="index_schema" value="${schema}"/>
                                     <Input name="index_name" value="${indexName}"/>
                                  </Command>
                               </DataNode>
                            </DataNode>
                         </GroupNode>

                         <GroupNode type="Triggers" label="Triggers">
                            <DataNode type="Trigger" label="${mimer.getTriggers.TRIGGER_NAME}" isLeaf="true">
                               <SetVar name="objectname" value="${mimer.getTriggers.TRIGGER_NAME}"/>
                               <Command idref="mimer.getTriggers">
                                  <Input name="trigger_schema" value="${schema}"/>
                                  <Input name="tableNamePattern" value="${theTableName}"/>
                               </Command>
                            </DataNode>
                         </GroupNode>

                         <If test="#util.isDatabaseVersionGTE(10,1)">
                            <GroupNode type="AccessPaths" label="Access Paths">
                               <DataNode type="AccessPath" label="${mimer.getTableAccessPathNames.ACCESS_PATH_NAME}">
                                  <SetVar name="objectname" value="${mimer.getTableAccessPathNames.ACCESS_PATH_NAME}"/>
                                  <SetVar name="access_path_name" value="${mimer.getTableAccessPathNames.ACCESS_PATH_NAME}"/>
                                  <SetVar name="access_path_type" value="${mimer.getTableAccessPathNames.ACCESS_PATH_TYPE}"/>
                                  <Command idref="mimer.getTableAccessPathNames"/>
                                  <DataNode type="AccessPathColumn" label="${mimer.getTableAccessPathColumns.COLUMN_NAME}" isLeaf="true">
                                     <SetVar name="objectname" value="${mimer.getTableAccessPathColumns.COLUMN_NAME}"/>
                                     <Command idref="mimer.getTableAccessPathColumns"/>
                                  </DataNode>
                                </DataNode>
                            </GroupNode>
                         </If>

                      </DataNode>
                   </GroupNode>

                   <GroupNode type="Views" label="Views">
                      <DataNode type="View" label="${mimer.getViews.TABLE_NAME}" isLeaf="false">
                         <SetVar name="objectname" value="${mimer.getViews.TABLE_NAME}"/>
                         <SetVar name="rowcount" value="true"/>
                         <SetVar name="acceptInQB" value="true"/>
                         <Command idref="mimer.getViews">
                            <Input name="view_schema" value="${schema}"/>
                         </Command>

                         <GroupNode type="Columns" label="Columns">
                            <SetVar name="theTableName" value="${objectname}"/>
                            <DataNode type="ViewColumn" label="${getColumnDefinitions.COLUMN_NAME}"
                                      label1="${getColumnDefinitions.TYPE_NAME}"
                                      isLeaf="true">
                               <SetVar name="tablename" value="${theTableName}"/>
                               <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                               <Command idref="getColumnDefinitions">
                                  <Input name="schema" value="${schema}"/>
                                  <Input name="objectname" value="${theTableName}"/>
                                  <Input name="tableType" value="View"/>
                                  <Filter index="TYPE_NAME" label="Type"/>
                               </Command>
                            </DataNode>
                         </GroupNode>

                         <GroupNode type="Triggers" label="Triggers">
                            <SetVar name="theTableName" value="${objectname}"/>
                            <DataNode type="Trigger" label="${mimer.getTriggers.TRIGGER_NAME}" isLeaf="true">
                               <SetVar name="objectname" value="${mimer.getTriggers.TRIGGER_NAME}"/>
                               <Command idref="mimer.getTriggers">
                                  <Input name="trigger_schema" value="${schema}"/>
                                  <Input name="tableNamePattern" value="${theTableName}"/>
                               </Command>
                            </DataNode>
                         </GroupNode>
                      </DataNode>
                   </GroupNode>

                   <SetVar name="theTableName" value="%"/>

                   <GroupNode type="Triggers" label="Triggers">
                      <DataNode type="Trigger" label="${mimer.getTriggers.TRIGGER_NAME}" isLeaf="true">
                         <SetVar name="objectname" value="${mimer.getTriggers.TRIGGER_NAME}"/>
                         <Command idref="mimer.getTriggers">
                            <Input name="trigger_schema" value="${schema}"/>
                            <Input name="tableNamePattern" value="${theTableName}"/>
                         </Command>
                      </DataNode>
                   </GroupNode>

                   <GroupNode type="Synonyms" label="Synonyms">
                      <DataNode type="Synonym" label="${mimer.getSynonyms.SYNONYM_NAME}" isLeaf="true">
                         <SetVar name="objectname" value="${mimer.getSynonyms.SYNONYM_NAME}"/>
                         <SetVar name="rowcount" value="true"/>
                         <SetVar name="acceptInQB" value="true"/>
                         <Command idref="mimer.getSynonyms">
                            <Input name="synonym_schema" value="${schema}"/>
                         </Command>
                      </DataNode>
                   </GroupNode>

                   <GroupNode type="Indexes" label="Indexes">
                      <DataNode type="Index" label="${mimer.getIndexes.INDEX_NAME}">
                         <SetVar name="objectname" value="${mimer.getIndexes.INDEX_NAME}"/>
                         <SetVar name="tablename" value="${mimer.getIndexes.TABLE_NAME}"/>
                         <SetVar name="indexName" value="${mimer.getIndexes.INDEX_NAME}"/>
                         <Command idref="mimer.getIndexes">
                            <Input name="index_schema" value="${schema}"/>
                            <Input name="tableNamePattern" value="${theTableName}"/>
                         </Command>
                         <DataNode type="Column" label="${mimer.getIndexColumns.COLUMN_NAME}" isLeaf="true">
                            <SetVar name="columnschema" value="${mimer.getIndexColumns.INDEX_SCHEMA}"/>
                            <SetVar name="objectname" value="${mimer.getIndexColumns.COLUMN_NAME}"/>
                            <Command idref="mimer.getIndexColumns">
                               <Input name="index_schema" value="${schema}"/>
                               <Input name="index_name" value="${indexName}"/>
                            </Command>
                         </DataNode>
                      </DataNode>
                   </GroupNode>

                   <GroupNode type="Sequences" label="Sequences">
                      <DataNode type="Sequence" label="${mimer.getSequences.SEQUENCE_NAME}" isLeaf="true">
                         <SetVar name="objectname" value="${mimer.getSequences.SEQUENCE_NAME}"/>
                         <Command idref="mimer.getSequences">
                            <Input name="sequence_schema" value="${schema}"/>
                         </Command>
                      </DataNode>
                   </GroupNode>

                   <GroupNode type="Functions" label="Functions">
                      <If test="#util.isDatabaseVersionLTE(9,2)">
                         <!-- Version 9.2 or earlier. Do not use specific name in label -->
                         <DataNode type="Function" label="${mimer.getRoutines.ROUTINE_NAME}" isLeaf="false">
                            <SetVar name="objectname" value="${mimer.getRoutines.ROUTINE_NAME}"/>
                            <SetVar name="specificname" value="${mimer.getRoutines.SPECIFIC_NAME}"/>
                            <SetVar name="getDDLName" value="${objectname}/"/>
                            <SetVar name="routinetype" value="FUNCTION"/>
                            <Command idref="mimer.getRoutines">
                               <Input name="routinetype" value="FUNCTION"/>
                               <Input name="specificname" value="%"/>
                            </Command>
                            <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                               <Command idref="mimer.getRoutineResult"/>
                            </DataNode>
                            <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                      label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                      isLeaf="true">
                               <Command idref="mimer.getRoutineParameters"/>
                            </DataNode>
                         </DataNode>
                      </If>
                      <Else>
                         <!-- Version 9.3 or later. Must use specific name in label -->
                         <DataNode type="Function" label="${mimer.getRoutines.ROUTINE_NAME} (${mimer.getRoutines.SPECIFIC_NAME})"
                                   isLeaf="false">
                            <SetVar name="objectname" value="${mimer.getRoutines.ROUTINE_NAME}"/>
                            <SetVar name="specificname" value="${mimer.getRoutines.SPECIFIC_NAME}"/>
                            <SetVar name="getDDLName" value="${objectname}/${specificname}"/>
                            <SetVar name="routinetype" value="FUNCTION"/>
                            <Command idref="mimer.getRoutines">
                               <Input name="routinetype" value="FUNCTION"/>
                               <Input name="specificname" value="%"/>
                            </Command>
                            <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                               <Command idref="mimer.getRoutineResult"/>
                            </DataNode>
                            <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                      label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                      isLeaf="true">
                               <Command idref="mimer.getRoutineParameters"/>
                            </DataNode>
                         </DataNode>
                      </Else>
                   </GroupNode>

                   <GroupNode type="Procedures" label="Procedures">
                      <If test="#util.isDatabaseVersionLTE(9,2)">
                         <!-- Version 9.2 or earlier. Do not use specific name in label -->
                         <DataNode type="Procedure" label="${mimer.getRoutines.ROUTINE_NAME}" isLeaf="false">
                            <SetVar name="objectname" value="${mimer.getRoutines.ROUTINE_NAME}"/>
                            <SetVar name="specificname" value="${mimer.getRoutines.SPECIFIC_NAME}"/>
                            <SetVar name="routinetype" value="PROCEDURE"/>
                            <SetVar name="getDDLName" value="${objectname}/"/>
                            <Command idref="mimer.getRoutines">
                               <Input name="routinetype" value="PROCEDURE"/>
                               <Input name="specificname" value="%"/>
                            </Command>
                            <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                      label1="${mimer.getRoutineParameters.PARAMETER_MODE} - ${mimer.getRoutineParameters.DATA_TYPE}"
                                      isLeaf="true">
                               <Command idref="mimer.getRoutineParameters"/>
                            </DataNode>
                         </DataNode>
                      </If>
                      <Else>
                         <!-- Version 9.3 or later. Must use specific name in label -->
                         <DataNode type="Procedure" label="${mimer.getRoutines.ROUTINE_NAME} (${mimer.getRoutines.SPECIFIC_NAME})"
                                   isLeaf="false">
                            <SetVar name="objectname" value="${mimer.getRoutines.ROUTINE_NAME}"/>
                            <SetVar name="specificname" value="${mimer.getRoutines.SPECIFIC_NAME}"/>
                            <SetVar name="routinetype" value="PROCEDURE"/>
                            <SetVar name="getDDLName" value="${objectname}/${specificname}"/>
                            <Command idref="mimer.getRoutines">
                               <Input name="routinetype" value="PROCEDURE"/>
                               <Input name="specificname" value="%"/>
                            </Command>
                            <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                      label1="${mimer.getRoutineParameters.PARAMETER_MODE} - ${mimer.getRoutineParameters.DATA_TYPE}"
                                      isLeaf="true">
                               <Command idref="mimer.getRoutineParameters"/>
                            </DataNode>
                         </DataNode>
                      </Else>
                   </GroupNode>

                   <GroupNode type="Modules" label="Modules">
                      <DataNode type="Module" label="${mimer.getModules.MODULE_NAME}" isLeaf="false">
                         <SetVar name="objectname" value="${mimer.getModules.MODULE_NAME}"/>
                         <SetVar name="getDDLName" value="${mimer.getModules.MODULE_NAME}/"/>
                         <Command idref="mimer.getModules">
                            <Input name="module_schema" value="${schema}"/>
                         </Command>
                         <DataNode type="ModuleProcedure" label="${mimer.getModuleRoutinesByType.ROUTINE_NAME}" isLeaf="false">
                            <SetVar name="objectname" value="${mimer.getModuleRoutinesByType.ROUTINE_NAME}"/>
                            <SetVar name="specificname" value="${mimer.getModuleRoutinesByType.SPECIFIC_NAME}"/>
                            <SetVar name="routinetype" value="PROCEDURE"/>
                            <Command idref="mimer.getModuleRoutinesByType">
                               <Input name="module_schema" value="${schema}"/>
                               <Input name="module_name" value="${objectname}"/>
                               <Input name="routine_type" value="PROCEDURE"/>
                            </Command>
                            <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                      label1="${mimer.getRoutineParameters.PARAMETER_MODE} - ${mimer.getRoutineParameters.DATA_TYPE}"
                                      isLeaf="true">
                               <Command idref="mimer.getRoutineParameters"/>
                            </DataNode>
                         </DataNode>
                         <DataNode type="ModuleFunction" label="${mimer.getModuleRoutinesByType.ROUTINE_NAME}" isLeaf="false">
                            <SetVar name="objectname" value="${mimer.getModuleRoutinesByType.ROUTINE_NAME}"/>
                            <SetVar name="specificname" value="${mimer.getModuleRoutinesByType.SPECIFIC_NAME}"/>
                            <SetVar name="routinetype" value="FUNCTION"/>
                            <Command idref="mimer.getModuleRoutinesByType">
                               <Input name="module_schema" value="${schema}"/>
                               <Input name="module_name" value="${objectname}"/>
                               <Input name="routine_type" value="FUNCTION"/>
                            </Command>
                            <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                               <Command idref="mimer.getRoutineResult"/>
                            </DataNode>
                            <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                      label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                      isLeaf="true">
                               <Command idref="mimer.getRoutineParameters"/>
                            </DataNode>
                         </DataNode>
                      </DataNode>
                   </GroupNode>

                   <If test="#util.isDatabaseVersionGTE(10,1)">
                      <GroupNode type="Types" label="User defined types">
                         <GroupNode type="DistinctTypes" label="Distinct Types">
                            <DataNode type="DistinctType" label="${mimer.getUserDefinedTypes.USER_DEFINED_TYPE_NAME}"
                                      label1="${mimer.getUserDefinedTypes.DATA_TYPE}"
                                      isLeaf="false">
                               <SetVar name="userDefinedTypeCategory" value="DISTINCT"/>
                               <SetVar name="objectname" value="${mimer.getUserDefinedTypes.USER_DEFINED_TYPE_NAME}"/>
                               <SetVar name="udtname" value="${mimer.getUserDefinedTypes.USER_DEFINED_TYPE_NAME}"/>
                               <SetVar name="attributeLikePattern" value="%"/>
                               <Command idref="mimer.getUserDefinedTypes">
                                  <Input name="userDefinedTypePattern" value="%"/>
                                  <Input name="userDefinedTypeCategory" value="DISTINCT"/>
                               </Command>
                               <!--<DataNode type="Function" label="${mimer.getRoutinesForUdt.ROUTINE_NAME} (${mimer.getRoutinesForUdt.SPECIFIC_NAME})">
                        <SetVar name="objectname" value="${mimer.getRoutinesForUdt.ROUTINE_NAME}"/>
                        <SetVar name="specificname" value="${mimer.getRoutinesForUdt.SPECIFIC_NAME}"/>
                        <SetVar name="getDDLName" value="${objectname}/${specificname}"/>
                        <SetVar name="routinetype" value="FUNCTION"/>
                        <Command idref="mimer.getRoutinesForUdt">
                          <Input name="routinetype" value="FUNCTION"/>
                          <Input name="specificname" value="%"/>
                        </Command>
                        <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                          <Command idref="mimer.getRoutineResult"/>
                        </DataNode>
                        <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME} - ${mimer.getRoutineParameters.DATA_TYPE}" isLeaf="true">
                          <Command idref="mimer.getRoutineParameters"/>
                        </DataNode>
                      </DataNode>-->

                               <GroupNode type="InstanceMethods" label="Instance Methods">
                                  <DataNode type="InstanceMethodUndef" label="${mimer.getUDTRoutinesUndef.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutinesUndef.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="INSTANCE METHOD"/>
                                     <Command idref="mimer.getUDTRoutinesUndef">
                                        <Input name="routinetype" value="INSTANCE METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getMethodResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getMethodResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getMethodParameters.PARAMETER_NAME}"
                                               label1="${mimer.getMethodParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getMethodParameters"/>
                                     </DataNode>
                                  </DataNode>
                                  <DataNode type="InstanceMethod" label="${mimer.getUDTRoutines.METHOD_NAME}"
                                          label1="${mimer.getUDTRoutines.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutines.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutines.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="INSTANCE METHOD"/>
                                     <Command idref="mimer.getUDTRoutines">
                                        <Input name="routinetype" value="INSTANCE METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getRoutineResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                               label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getRoutineParameters"/>
                                     </DataNode>
                                  </DataNode>
                               </GroupNode>

                               <GroupNode type="StaticMethods" label="Static Methods">
                                  <DataNode type="StaticMethodUndef" label="${mimer.getUDTRoutinesUndef.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutinesUndef.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="STATIC METHOD"/>
                                     <Command idref="mimer.getUDTRoutinesUndef">
                                        <Input name="routinetype" value="STATIC METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getMethodResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getMethodResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getMethodParameters.PARAMETER_NAME}"
                                               label1="${mimer.getMethodParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getMethodParameters"/>
                                     </DataNode>
                                  </DataNode>
                                  <DataNode type="StaticMethod" label="${mimer.getUDTRoutines.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutines.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutines.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutines.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="STATIC METHOD"/>
                                     <Command idref="mimer.getUDTRoutines">
                                        <Input name="routinetype" value="STATIC METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getRoutineResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                               label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getRoutineParameters"/>
                                     </DataNode>
                                  </DataNode>
                               </GroupNode>
                            </DataNode>
                         </GroupNode>
                         <GroupNode type="StructuredTypes" label="Structured Types">
                            <DataNode type="StructuredType" label="${mimer.getUserDefinedTypes.USER_DEFINED_TYPE_NAME}" isLeaf="false">
                               <SetVar name="userDefinedTypeCategory" value="STRUCTURED"/>
                               <SetVar name="objectname" value="${mimer.getUserDefinedTypes.USER_DEFINED_TYPE_NAME}"/>
                               <SetVar name="udtname" value="${mimer.getUserDefinedTypes.USER_DEFINED_TYPE_NAME}"/>
                               <SetVar name="attributeLikePattern" value="%"/>
                               <Command idref="mimer.getUserDefinedTypes">
                                  <Input name="userDefinedTypePattern" value="%"/>
                                  <Input name="userDefinedTypeCategory" value="STRUCTURED"/>
                               </Command>
                               <GroupNode type="Attributes" label="Attributes">
                                  <DataNode type="Attribute" label="${mimer.getUDTAttributes.ATTRIBUTE_NAME}"
                                            label1="${mimer.getUDTAttributes.DATA_TYPE}"
                                            isLeaf="true">
                                     <SetVar name="attributeLikePattern" value="${mimer.getUDTAttributes.ATTRIBUTE_NAME}"/>
                                     <SetVar name="objectname" value="${mimer.getUDTAttributes.ATTRIBUTE_NAME}"/>
                                     <Command idref="mimer.getUDTAttributes"/>
                                  </DataNode>
                               </GroupNode>
                               <!--<DataNode type="Function" label="${mimer.getRoutinesForUdt.ROUTINE_NAME} (${mimer.getRoutinesForUdt.SPECIFIC_NAME})">
                        <SetVar name="objectname" value="${mimer.getRoutinesForUdt.ROUTINE_NAME}"/>
                        <SetVar name="specificname" value="${mimer.getRoutinesForUdt.SPECIFIC_NAME}"/>
                        <SetVar name="getDDLName" value="${objectname}/${specificname}"/>
                        <SetVar name="routinetype" value="FUNCTION"/>
                        <Command idref="mimer.getRoutinesForUdt">
                          <Input name="routinetype" value="FUNCTION"/>
                          <Input name="specificname" value="%"/>
                        </Command>
                        <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                          <Command idref="mimer.getRoutineResult"/>
                        </DataNode>
                        <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME} - ${mimer.getRoutineParameters.DATA_TYPE}" isLeaf="true">
                          <Command idref="mimer.getRoutineParameters"/>
                        </DataNode>
                      </DataNode>-->

                               <GroupNode type="ConstructorMethods" label="Constructor Methods">
                                  <DataNode type="ConstructorMethodUndef" label="${mimer.getUDTRoutinesUndef.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}">
                                     <SetVar name="routinetype" value="CONSTRUCTOR METHOD"/>
                                     <SetVar name="objectname" value="${mimer.getUDTRoutinesUndef.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}"/>
                                     <Command idref="mimer.getUDTRoutinesUndef">
                                        <Input name="routinetype" value="CONSTRUCTOR METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getMethodResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getMethodResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getMethodParameters.PARAMETER_NAME}"
                                               label1="${mimer.getMethodParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getMethodParameters"/>
                                     </DataNode>
                                  </DataNode>
                                  <DataNode type="ConstructorMethod" label="${mimer.getUDTRoutines.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutines.SPECIFIC_NAME}">
                                     <SetVar name="routinetype" value="CONSTRUCTOR METHOD"/>
                                     <SetVar name="objectname" value="${mimer.getUDTRoutines.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutines.SPECIFIC_NAME}"/>
                                     <Command idref="mimer.getUDTRoutines">
                                        <Input name="routinetype" value="CONSTRUCTOR METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getRoutineResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                               label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getRoutineParameters"/>
                                     </DataNode>
                                  </DataNode>
                               </GroupNode>

                               <GroupNode type="InstanceMethods" label="Instance Methods">
                                  <DataNode type="InstanceMethodUndef" label="${mimer.getUDTRoutinesUndef.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutinesUndef.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="INSTANCE METHOD"/>
                                     <Command idref="mimer.getUDTRoutinesUndef">
                                        <Input name="routinetype" value="INSTANCE METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getMethodResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getMethodResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getMethodParameters.PARAMETER_NAME}"
                                               label1="${mimer.getMethodParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getMethodParameters"/>
                                     </DataNode>
                                  </DataNode>
                                  <DataNode type="InstanceMethod" label="${mimer.getUDTRoutines.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutines.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutines.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutines.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="INSTANCE METHOD"/>
                                     <Command idref="mimer.getUDTRoutines">
                                        <Input name="routinetype" value="INSTANCE METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getRoutineResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                               label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getRoutineParameters"/>
                                     </DataNode>
                                  </DataNode>
                               </GroupNode>

                               <GroupNode type="StaticMethods" label="Static Methods">
                                  <DataNode type="StaticMethodUndef" label="${mimer.getUDTRoutinesUndef.METHOD_NAME}"
                                          label1="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutinesUndef.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutinesUndef.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="STATIC METHOD"/>
                                     <Command idref="mimer.getUDTRoutinesUndef">
                                        <Input name="routinetype" value="STATIC METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getMethodResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getMethodResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getMethodParameters.PARAMETER_NAME}"
                                               label1="${mimer.getMethodParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getMethodParameters"/>
                                     </DataNode>
                                  </DataNode>
                                  <DataNode type="StaticMethod" label="${mimer.getUDTRoutines.METHOD_NAME}"
                                            label1="${mimer.getUDTRoutines.SPECIFIC_NAME}">
                                     <SetVar name="objectname" value="${mimer.getUDTRoutines.METHOD_NAME}"/>
                                     <SetVar name="specificname" value="${mimer.getUDTRoutines.SPECIFIC_NAME}"/>
                                     <SetVar name="routinetype" value="STATIC METHOD"/>
                                     <Command idref="mimer.getUDTRoutines">
                                        <Input name="routinetype" value="STATIC METHOD"/>
                                     </Command>
                                     <DataNode type="Output" label="RETURN_VALUE - ${mimer.getRoutineResult.DATA_TYPE}" isLeaf="true">
                                        <Command idref="mimer.getRoutineResult"/>
                                     </DataNode>
                                     <DataNode type="Input" label="${mimer.getRoutineParameters.PARAMETER_NAME}"
                                               label1="${mimer.getRoutineParameters.DATA_TYPE}"
                                               isLeaf="true">
                                        <Command idref="mimer.getRoutineParameters"/>
                                     </DataNode>
                                  </DataNode>
                               </GroupNode>
                            </DataNode>
                         </GroupNode>
                      </GroupNode>
                   </If>

                   <GroupNode type="Domains" label="Domains">
                      <DataNode type="Domain" label="${mimer.getDomains.DOMAIN_NAME}" isLeaf="true">
                         <SetVar name="objectname" value="${mimer.getDomains.DOMAIN_NAME}"/>
                         <Command idref="mimer.getDomains">
                            <Input name="domain_schema" value="${schema}"/>
                         </Command>
                      </DataNode>
                   </GroupNode>

                   <GroupNode type="Collations" label="Collations">
                      <DataNode type="Collation" label="${mimer.getCollations.COLLATION_NAME}" isLeaf="true">
                         <SetVar name="objectname" value="${mimer.getCollations.COLLATION_NAME}"/>
                         <Command idref="mimer.getCollations">
                            <Input name="collation_schema" value="${schema}"/>
                         </Command>
                      </DataNode>
                   </GroupNode>

                   <!-- Test needs to be this way if getDatabaseMajorVersion not supported (JDBC1,2 driver) -->
                   <If test="#util.isDatabaseVersionLT(9)">
                   </If>
                   <Else>
                      <GroupNode type="Statements" label="Statements">
                         <DataNode type="Statement" label="${mimer.getStatements.STATEMENT_NAME}" isLeaf="true">
                            <SetVar name="objectname" value="${mimer.getStatements.STATEMENT_NAME}"/>
                            <Command idref="mimer.getStatements">
                               <Input name="statement_schema" value="${schema}"/>
                               <Input name="statement_name" value="%"/>
                            </Command>
                         </DataNode>
                      </GroupNode>
                   </Else>
                </DataNode>
             </GroupNode>

             <GroupNode type="BaseTypes" label="Data types">
                <DataNode type="BaseType" label="${mimer.getDataTypes.TYPE_NAME}" isLeaf="true">
                   <SetVar name="objectname" value="${mimer.getDataTypes.TYPE_NAME}"/>
                   <Command idref="mimer.getDataTypes">
                      <Input name="type_categories" value="'DATA TYPE'"/>
                   </Command>
                </DataNode>
             </GroupNode>
             <GroupNode type="Properties" label="Session Properties" isLeaf="true"/>

             <GroupNode type="DBA" label="DBA Views">
                <GroupNode type="Users" label="Users">
                   <DataNode type="User" label="${mimer.getIdents.IDENT_NAME}" isLeaf="true">
                      <SetVar name="objectname" value="${mimer.getIdents.IDENT_NAME}"/>
                      <Command idref="mimer.getIdents">
                         <Input name="ident_type" value="'USER','OS_USER'"/>
                      </Command>
                   </DataNode>
                </GroupNode>

                <GroupNode type="Programs" label="Programs">
                   <DataNode type="Program" label="${mimer.getIdents.IDENT_NAME}" isLeaf="true">
                      <SetVar name="objectname" value="${mimer.getIdents.IDENT_NAME}"/>
                      <Command idref="mimer.getIdents">
                         <Input name="ident_type" value="'PROGRAM'"/>
                      </Command>
                   </DataNode>
                </GroupNode>

                <GroupNode type="Groups" label="Groups">
                   <DataNode type="Group" label="${mimer.getIdents.IDENT_NAME}" isLeaf="true">
                      <SetVar name="objectname" value="${mimer.getIdents.IDENT_NAME}"/>
                      <Command idref="mimer.getIdents">
                         <Input name="ident_type" value="'GROUP'"/>
                      </Command>
                   </DataNode>
                </GroupNode>

                <GroupNode type="Databanks" label="Databanks">
                   <DataNode type="Databank" label="${mimer.getDatabanks.DATABANK_NAME}" isLeaf="true">
                      <SetVar name="objectname" value="${mimer.getDatabanks.DATABANK_NAME}"/>
                      <SetVar name="currentminsize" value="${mimer.getDatabanks.MINSIZE}"/>
                      <SetVar name="currentmaxsize" value="${mimer.getDatabanks.MAXSIZE}"/>
                      <Command idref="mimer.getDatabanks"/>
                   </DataNode>
                </GroupNode>

                <GroupNode type="Shadows" label="Shadows">
                   <DataNode type="Shadow" label="${mimer.getShadows.SHADOW_NAME}" isLeaf="true">
                      <SetVar name="objectname" value="${mimer.getShadows.SHADOW_NAME}"/>
                      <Command idref="mimer.getShadows"/>
                   </DataNode>
                </GroupNode>

                <If test="#util.isDatabaseVersionLT(9,3)">
                </If>
                <Else>
                   <!-- Version 9.3 or later -->
                   <GroupNode type="Subscriptions" label="Subscriptions">
                      <DataNode type="Subscription" label="${mimer.getSubscriptions.SUBSCRIPTION_NAME}" isLeaf="true">
                         <SetVar name="objectname" value="${mimer.getSubscriptions.SUBSCRIPTION_NAME}"/>
                         <Command idref="mimer.getSubscriptions"/>
                      </DataNode>
                   </GroupNode>
                </Else>
             </GroupNode>

             <GroupNode type="SqlStandards" label="SQL Standards">
                <!-- Test needs to be this way if getDatabaseMajorVersion not supported (JDBC1,2 driver) -->
                <If test="#util.isDatabaseVersionLT(9)">
                </If>
                <Else>
                   <GroupNode type="SqlStandard2003" label="SQL 1999 and 2003" isLeaf="true"/>
                </Else>
                <GroupNode type="SqlStandard1992" label="SQL 1992" isLeaf="true"/>
             </GroupNode>
          </Else>
      </Else>
   </ObjectsTreeDef>

   <!-- =================================================================== -->
   <!-- Definition of the database objects views                            -->
   <!-- =================================================================== -->

   <ObjectsViewDef extends="true">

      <ObjectView type="Catalogs" action="drop"/>
      <ObjectView type="Catalog" action="drop"/>

      <ObjectView type="Schemas">
         <DataView id="generic-schemas-schemas" action="drop"/>

         <DataView id="mimer-schemas-schemas" icon="Schemas" label="Schemas" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP SCHEMA Cascade">
                  <Input name="command" value="drop schema ${object||SCHEMA_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP SCHEMA Restrict">
               <Input name="command" value="drop schema ${object||SCHEMA_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getSchemas"/>
            <Message>
               <![CDATA[
<html>
This view shows all schemas the user has some kind of access to.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-schemas-schemafacts" icon="Comment" label="Schema Facts" viewer="grid">
            <Command idref="mimer.getSchemaFacts"/>
            <Message>
               <![CDATA[
<html>
This view shows schemas owned by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Schema">
         <DataView id="generic-schema-tables" action="drop"/>
         <DataView id="generic-schema-references" action="drop"/>

         <DataView id="mimer-schema-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getSchemaInfo">
               <Input name="schema_name" value="${schema}"/>
            </Command>
         </DataView>
         <DataView id="mimer-schema-comments" icon="Comment" label="Comments" viewer="grid">
            <Command idref="mimer.getSchemaComment"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Tables">
         <DataView id="generic-tables-tables" action="drop"/>
         <DataView id="generic-tables-references" action="drop"/>

         <DataView id="mimer-tables-tables" icon="Tables" label="Tables" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||TABLE_SCHEMA}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||TABLE_SCHEMA}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||TABLE_SCHEMA}${object||TABLE_NAME}"/>
            </Input>
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP TABLE Cascade">
                  <Input name="command" value="drop table ${schema||TABLE_SCHEMA}${object||TABLE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP TABLE Restrict">
               <Input name="command" value="drop table ${schema||TABLE_SCHEMA}${object||TABLE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getTables">
               <Input name="table_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows all tables for the selected schema that the connected user has access to.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-tables-references" icon="References" label="References" viewer="tables-refs"
                   doclink="http://www.dbvis.com/doclink/show-references">
            <Command idref="mimer.getTables">
               <Input name="table_schema" value="${schema}"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_SCHEMA" value="TABLE_SCHEM"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_CATALOG" value="TABLE_CAT"/>
            </Command>
         </DataView>
         <DataView id="mimer-tables-tablefacts" icon="Comment" label="Table Facts" viewer="grid">
            <Command idref="mimer.getTableFacts"/>
            <Message>
               <![CDATA[
<html>
This view shows extended information for all tables for the selected schema that the connected user has access to.
The CARDINALITY shown is the number of rows in the table the last time statistics were updated.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Table">
         <DataView id="generic-table-info" action="drop"/>
         <DataView id="generic-table-columns" action="drop"/>
         <DataView id="generic-table-index" action="drop"/>
         <DataView id="generic-table-primarykey" action="drop"/>
         <DataView id="generic-table-grants" action="drop"/>
         <DataView id="generic-table-rowid" action="drop"/>
         <!--Have to remove the generic-table-ddl here and use the specific -->
         <!--mimer-table-ddl below. The reason is that the mimer-table-ddl is -->
         <!--enclosed in a condition and cannot be properly evaluated -->
         <DataView id="generic-table-ddl" action="drop"/>

         <DataView id="mimer-table-info" icon="Info" label="Info" viewer="form" order-before="generic-table-data">
            <Command idref="mimer.getTableInfo">
               <Input name="table_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
               <Input name="table_name" value="${mimer.getTables.TABLE_NAME}"/>
            </Command>
         </DataView>
         <!--<DataView type="Columns" label="Columns" viewer="grid">
        <Command idref="mimer.getColumns">
          <Input name="table_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
          <Input name="table_name" value="${mimer.getTables.TABLE_NAME}"/>
        </Command>
      </DataView>-->

         <DataView id="mimer-table-comments" icon="Comment" label="Comments" viewer="grid">
            <Command idref="mimer.getColumnsComment">
               <Input name="table_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
               <Input name="table_name" value="${mimer.getTables.TABLE_NAME}"/>
               <Input name="object_type" value="BASE TABLE"/>
            </Command>
         </DataView>
         <!--<DataView type="Constraints" label="Constraints" viewer="grid">
        <Command idref="mimer.getTableConstraintsInfo">
          <Input name="table_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
          <Input name="table_name" value="${mimer.getTables.TABLE_NAME}"/>
        </Command>
        <Message>
          <![CDATA[
<html>
This view shows constraints if the table is created by the current user.
</html>
                 ]]>
        </Message>
      </DataView>-->
         <DataView id="mimer-table-primarykey" icon="PrimaryKey" label="Primary Key" viewer="grid">
            <Command idref="getPrimaryKeys">
               <Input name="schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
               <Input name="objectname" value="${mimer.getTables.TABLE_NAME}"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_SCHEM" value="TABLE_SCHEMA"/>
               <ProcessDataSet action="renamecolumn" index="KEY_SEQ" value="ORDINAL_POSITION"/>
               <ProcessDataSet action="renamecolumn" index="PK_NAME" value="CONSTRAINT_NAME"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_CAT"/>
            </Command>
         </DataView>
         <!--<DataView type="Index" label="Indexes" viewer="grid">
        <Command idref="mimer.getIndexColumnsByTable">
          <Input name="table_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
          <Input name="table_name" value="${mimer.getTables.TABLE_NAME}"/>
        </Command>
      </DataView>-->
         <DataView id="mimer-table-accessrights" icon="TablePrivileges" label="Access Rights" viewer="grid">
            <Command idref="getPrivileges">
               <Input name="schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
               <Input name="objectname" value="${mimer.getTables.TABLE_NAME}"/>
               <!-- <ProcessDataSet action="renamecolumn" index="TABLE_SCHEM" value="TABLE_SCHEMA"/> -->
               <ProcessDataSet action="dropcolumn" index="TABLE_CAT"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_SCHEM"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_NAME"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows access rights granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <!-- Do not have row ids in Mimer -->
         <DataView id="mimer-table-tableusedby" icon="ObjectsUsed" label="Table used by" viewer="grid">
            <Command idref="mimer.getTableUsed">
               <Input name="object_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getTables.TABLE_NAME}"/>
               <Input name="object_type" value="BASE TABLE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the table owner, this view shows all database objects that uses the table.
For other users, the view only shows objects that uses the table that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-table-tableuses" icon="ObjectsUsing" label="Table uses" viewer="grid">
            <Command idref="mimer.getObjectsUsingTable">
               <Input name="object_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getTables.TABLE_NAME}"/>
               <Input name="object_type" value="BASE TABLE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the table owner, this view shows all database objects that are used by the table.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <!--<DataView type="Trigger" label="Triggers" viewer="grid">
        <Command idref="mimer.getTableTriggers">
          <Input name="object_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
          <Input name="object_table" value="${mimer.getTables.TABLE_NAME}"/>
        </Command>
        <Message>
          <![CDATA[
<html>
This view shows defined triggers if the table is created by the current user.
</html>
                 ]]>
        </Message>
      </DataView>-->
         <If test="#util.isDatabaseVersionLT(9,3)">
         </If>
         <Else>
            <DataView id="mimer-table-subscriptions" icon="Subscription" label="Subscriptions" viewer="grid">
               <Command idref="mimer.getTableSubscriptions">
                  <Input name="source_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
                  <Input name="source_table" value="${mimer.getTables.TABLE_NAME}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
If replication has been activated this view shows all subscriptions that the current table is used in.
</html>
                 ]]>
               </Message>
            </DataView>
         </Else>
         <If test="! #util.isLicensed()">  <!-- Free -->
            <DataView id="mimer-table-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="mimer.getTableSource">
                  <Input name="table_schema" value="${mimer.getTables.TABLE_SCHEMA}"/>
                  <Input name="table_name" value="${mimer.getTables.TABLE_NAME}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object. Only the creator of the object can see constraints and keys.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
         <Else>
            <DataView id="mimer-table-ddl" icon="Source" label="DDL" viewer="ddl">
               <Input name="formatSQL" value="true"/>
            </DataView>
         </Else>
      </ObjectView>

      <ObjectView type="Constraints">
         <DataView id="mimer-constraints-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="mimer.getTableConstraints">
               <Input name="table_schema" value="${schema}"/>
               <Input name="table_name" value="${theTableName}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows constraints if the table is created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Constraint">
         <DataView id="mimer-constraint-constraint" icon="Constraint" label="Constraint" viewer="form">
            <Command idref="mimer.getTableConstraint">
               <Input name="table_schema" value="${schema}"/>
               <Input name="table_name" value="${theTableName}"/>
               <Input name="constraint_name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows a constraint if the table is created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constraint-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getConstraintSource">
               <Input name="table_schema" value="${schema}"/>
               <Input name="table_name" value="${theTableName}"/>
               <Input name="constraint_name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Columns">
         <DataView id="generic-columns-columns" action="drop"/>

         <DataView id="mimer-columns-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="mimer.getColumns">
               <Input name="table_schema" value="${schema}"/>
               <Input name="table_name" value="${theTableName}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Column">
         <DataView id="generic-column-column" action="drop"/>

         <DataView id="mimer-column-column" icon="Column" label="Column" viewer="node-form"/>
         <DataView id="mimer-column-columnprivileges" icon="TablePrivileges" label="Column Privileges" viewer="grid">
            <Command idref="mimer.getTableColumnPrivileges">
               <Input name="table_schema" value="${columnschema}"/>
               <Input name="table_name" value="${tablename}"/>
               <Input name="column_name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the access privileges for the column that the current user is allowed to see.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-column-columnusedby" icon="ObjectsUsed" label="Column used by" viewer="grid">
            <Command idref="mimer.getColumnUsed">
               <Input name="table_schema" value="${columnschema}"/>
               <Input name="table_name" value="${tablename}"/>
               <Input name="column_name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the table owner, this view shows all database objects that uses the column.
For other users, the view only shows objects that uses the column that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-column-columnuses" icon="ObjectsUsing" label="Column uses" viewer="grid">
            <Command idref="mimer.getColumnUses"/>
            <Message>
               <![CDATA[
<html>
For the table owner, this view shows all database objects that are used by the column.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="ViewColumn">
         <DataView id="mimer-viewcolumn-column" icon="Column" label="Column" viewer="node-form"/>
         <DataView id="mimer-viewcolumn-columnprivileges" icon="TablePrivileges" label="Column Privileges" viewer="grid">
            <Command idref="mimer.getTableColumnPrivileges">
               <Input name="table_schema" value="${schema}"/>
               <Input name="table_name" value="${tablename}"/>
               <Input name="column_name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the access privileges for the column that the current user is allowed to see.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-viewcolumn-columnusedby" icon="ObjectsUsed" label="Column used by" viewer="grid">
            <Command idref="mimer.getColumnUsed">
               <Input name="table_schema" value="${schema}"/>
               <Input name="table_name" value="${tablename}"/>
               <Input name="column_name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the table owner, this view shows all database objects that uses the column.
For other users, the view only shows objects that uses the column that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-viewcolumn-columnuses" icon="ObjectsUsing" label="Column uses" viewer="grid">
            <Command idref="mimer.getColumnUses"/>
            <Message>
               <![CDATA[
<html>
For the table owner, this view shows all database objects that are used by the column.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="AccessPaths">
        <DataView id="mimer-accesspaths-accesspaths" icon="AccessPaths" label="Access Paths" viewer="grid">
           <Command idref="mimer.getTableAccessPathNames"/>
           <Message>
          <![CDATA[
<html>
This view shows access paths that the optimizer can use to speed up SQL execution when accessing a table.<br>
<b>All</b> columns that are present in the access path are shown, including primary key columns that are implicitly appended to a search path.
</html>
           ]]>
           </Message>
        </DataView>
      </ObjectView>

      <ObjectView type="AccessPath">
         <DataView id="mimer-accesspath-accesspath" icon="AccessPath" label="Access Path" viewer="form">
            <Command idref="mimer.getTableAccessPathInfo"/>
         </DataView>
         <DataView id="mimer-accesspath-columns" icon="Column" label="Columns" viewer="grid">
           <Command idref="mimer.getTableAccessPathColumns"/>
         </DataView>
      </ObjectView>

      <ObjectView type="AccessPathColumn">
         <DataView id="mimer-accesspathcolumn-column" icon="Column" label="Column" viewer="form">
            <Command idref="mimer.getTableAccessPathColumnInfo"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Views">
         <DataView id="mimer-views-views" icon="Views" label="Views" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||TABLE_SCHEMA}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||TABLE_SCHEMA}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||TABLE_SCHEMA}${object||TABLE_NAME}"/>
            </Input>
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP VIEW Cascade">
                  <Input name="command" value="drop view ${schema||TABLE_SCHEMA}${object||TABLE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP VIEW Restrict">
               <Input name="command" value="drop view ${schema||TABLE_SCHEMA}${object||TABLE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getViews">
               <Input name="view_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows views for the selected schema that the connected user has access to.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-views-viewfacts" icon="Comment" label="View Facts" viewer="grid">
            <Command idref="mimer.getViewFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="View">
         <DataView id="mimer-view-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getViewInfo">
               <Input name="view_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="view_name" value="${mimer.getViews.TABLE_NAME}"/>>
            </Command>
         </DataView>
         <!--<DataView type="Columns" label="Columns" viewer="grid">
        <Command idref="mimer.getColumns">
          <Input name="table_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
          <Input name="table_name" value="${mimer.getViews.TABLE_NAME}"/>
        </Command>
      </DataView>-->
         <DataView id="mimer-view-data" icon="Data" label="Data" viewer="table-data"/>
         <DataView id="mimer-view-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount"/>
         <DataView id="mimer-view-references" icon="References" label="References" viewer="tables-refs">
            <Command idref="mimer.getViewInfo">
               <Input name="view_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="view_name" value="${mimer.getViews.TABLE_NAME}"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_SCHEMA" value="TABLE_SCHEM"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_NAME" value="TABLE_NAME"/>
            </Command>
         </DataView>
         <DataView id="mimer-view-comments" icon="Comment" label="Comments" viewer="grid">
            <Command idref="mimer.getColumnsComment">
               <Input name="table_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="table_name" value="${mimer.getViews.TABLE_NAME}"/>
               <Input name="object_type" value="VIEW"/>
            </Command>
         </DataView>
         <DataView id="mimer-view-accessrights" icon="TablePrivileges" label="Access Rights" viewer="grid">
            <Command idref="getPrivileges">
               <Input name="schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="table" value="${mimer.getViews.TABLE_NAME}"/>
               <!-- <ProcessDataSet action="renamecolumn" index="TABLE_SCHEM" value="TABLE_SCHEMA"/> -->
               <ProcessDataSet action="dropcolumn" index="TABLE_CAT"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_SCHEM"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_NAME"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows access rights granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-view-viewusedby" icon="ObjectsUsed" label="View used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getViews.TABLE_NAME}"/>
               <Input name="object_type" value="VIEW"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the view owner, this view shows all database objects that uses the view.
For other users, the view only shows objects that uses the view that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-view-viewuses" icon="ObjectsUsing" label="View uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getViews.TABLE_NAME}"/>
               <Input name="object_type" value="VIEW"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the <b>view</b> owner, this view shows all database objects that are used by the <b>view</b>.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <!--<DataView type="Trigger" label="Triggers" viewer="form">
        <Command idref="mimer.getTableTriggers">
          <Input name="object_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
          <Input name="object_table" value="${mimer.getViews.TABLE_NAME}"/>
        </Command>
        <Message>
          <![CDATA[
<html>
This view shows defined instead-of triggers for views created by the current user.
</html>
                 ]]>
        </Message>
      </DataView>-->
         <DataView id="mimer-view-ddl" icon="Source" label="DDL" viewer="text">
            <Input name="formatSQL" value="true"/>
            <Command idref="mimer.getViewSource">
               <Input name="view_schema" value="${mimer.getViews.TABLE_SCHEMA}"/>
               <Input name="view_name" value="${mimer.getViews.TABLE_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Synonyms">
         <DataView id="mimer-synonyms-synonyms" icon="Synonyms" label="Synonyms" viewer="grid">
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||SYNONYM_SCHEMA}${object||SYNONYM_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP SYNONYM">
               <Input name="command" value="drop synonym ${schema||SYNONYM_SCHEMA}${object||SYNONYM_NAME}"/>
            </Input>
            <Command idref="mimer.getSynonyms">
               <Input name="synonym_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows synonyms where the current user has access to the object the synonym refers to.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-synonyms-references" icon="References" label="References" viewer="tables-refs">
            <Command idref="getTables">
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="%"/>
               <Input name="tableType" value="SYNONYM"/>
            </Command>
         </DataView>
         <DataView id="mimer-synonyms-synonymfacts" icon="Comment" label="Synonym Facts" viewer="grid">
            <Command idref="mimer.getSynonymFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Synonym">
         <DataView id="mimer-synonym-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getSynonymInfo">
               <Input name="synonym_schema" value="${mimer.getSynonyms.SYNONYM_SCHEMA}"/>
               <Input name="synonym_name" value="${mimer.getSynonyms.SYNONYM_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-synonym-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="mimer.getColumns">
               <Input name="table_schema" value="${mimer.getSynonyms.TABLE_SCHEMA}"/>
               <Input name="table_name" value="${mimer.getSynonyms.TABLE_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-synonym-data" icon="Data" label="Data" viewer="table-data"/>
         <DataView id="mimer-synonym-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount"/>
         <DataView id="mimer-synonym-primarykey" icon="PrimaryKey" label="Primary Key" viewer="grid">
            <Command idref="getPrimaryKeys">
               <Input name="schema" value="${mimer.getSynonyms.TABLE_SCHEMA}"/>
               <Input name="objectname" value="${mimer.getSynonyms.TABLE_NAME}"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_SCHEM" value="TABLE_SCHEMA"/>
               <ProcessDataSet action="renamecolumn" index="KEY_SEQ" value="ORDINAL_POSITION"/>
               <ProcessDataSet action="renamecolumn" index="PK_NAME" value="CONSTRAINT_NAME"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_CAT"/>
            </Command>
         </DataView>
         <DataView id="mimer-synonym-indexes" icon="Index" label="Indexes" viewer="grid">
            <Command idref="mimer.getIndexColumnsByTable">
               <Input name="table_schema" value="${mimer.getSynonyms.TABLE_SCHEMA}"/>
               <Input name="table_name" value="${mimer.getSynonyms.TABLE_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-synonym-references" icon="References" label="References" viewer="tables-refs">
            <Command idref="getTables">
               <Input name="schema" value="${mimer.getSynonyms.SYNONYM_SCHEMA}"/>
               <Input name="objectname" value="${mimer.getSynonyms.SYNONYM_NAME}"/>
               <Input name="tableType" value="SYNONYM"/>
            </Command>
         </DataView>
         <DataView id="mimer-synonym-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="mimer.getTableConstraints">
               <Input name="table_schema" value="${mimer.getSynonyms.TABLE_SCHEMA}"/>
               <Input name="table_name" value="${mimer.getSynonyms.TABLE_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows constraints if the table is created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-synonym-accessrights" icon="TablePrivileges" label="Access Rights" viewer="grid">
            <Command idref="getPrivileges">
               <Input name="schema" value="${mimer.getSynonyms.TABLE_SCHEMA}"/>
               <Input name="objectname" value="${mimer.getSynonyms.TABLE_NAME}"/>
               <!-- <ProcessDataSet action="renamecolumn" index="TABLE_SCHEM" value="TABLE_SCHEMA"/> -->
               <ProcessDataSet action="dropcolumn" index="TABLE_CAT"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_SCHEM"/>
               <ProcessDataSet action="dropcolumn" index="TABLE_NAME"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows access rights granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-synonym-triggers" icon="Trigger" label="Triggers" viewer="form">
            <Command idref="mimer.getTableTriggers">
               <Input name="object_schema" value="${mimer.getSynonyms.TABLE_SCHEMA}"/>
               <Input name="object_table" value="${mimer.getSynonyms.TABLE_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows defined triggers if the table or view is created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-synonym-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getSynonymSource">
               <Input name="synonym_schema" value="${mimer.getSynonyms.SYNONYM_SCHEMA}"/>
               <Input name="synonym_name" value="${mimer.getSynonyms.SYNONYM_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Indexes">
         <DataView id="generic-indexes-indexes" action="drop"/>

         <DataView id="mimer-indexes-indexes" icon="Indexes" label="Indexes" viewer="grid">
            <Input name="menuItem" value="Script: DROP INDEX">
               <Input name="command" value="drop index ${schema||INDEX_SCHEMA}${object||INDEX_NAME}"/>
            </Input>
            <Command idref="mimer.getIndexes">
               <Input name="index_schema" value="${schema}"/>
               <Input name="tableNamePattern" value="${theTableName}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows indexes for tables the current user has access to.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-indexes-indexfacts" icon="Comment" label="Index Facts" viewer="grid">
            <Command idref="mimer.getIndexFacts">
               <Input name="tableNamePattern" value="${theTableName}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Index">
         <DataView id="generic-index-index" action="drop"/>

         <!--<DataView type="Info" label="Info" viewer="form">
        <Command idref="mimer.getIndexInfo">
          <Input name="index_schema" value="${mimer.getIndexes.INDEX_SCHEMA}"/>
          <Input name="index_name" value="${mimer.getIndexes.INDEX_NAME}"/>
        </Command>
      </DataView>-->
         <DataView id="mimer-index-columns" icon="Columns" label="Columns" viewer="form">
            <Command idref="mimer.getIndexColumns">
               <Input name="index_schema" value="${mimer.getIndexes.INDEX_SCHEMA}"/>
               <Input name="index_name" value="${mimer.getIndexes.INDEX_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-index-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getIndexSource">
               <Input name="index_schema" value="${mimer.getIndexes.INDEX_SCHEMA}"/>
               <Input name="index_name" value="${mimer.getIndexes.INDEX_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Sequences">
         <DataView id="mimer-sequences-sequences" icon="Sequences" label="Sequences" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP SEQUENCE Cascade">
                  <Input name="command" value="drop sequence ${schema||SEQUENCE_SCHEMA}${object||SEQUENCE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP SEQUENCE Restrict">
               <Input name="command" value="drop sequence ${schema||SEQUENCE_SCHEMA}${object||SEQUENCE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getSequences">
               <Input name="sequence_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows sequences that the current user is allowed to use.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-sequences-sequencefacts" icon="Comment" label="Sequence Facts" viewer="grid">
            <Command idref="mimer.getSequenceFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Sequence">
         <DataView id="mimer-sequence-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getSequenceInfo">
               <Input name="sequence_schema" value="${mimer.getSequences.SEQUENCE_SCHEMA}"/>
               <Input name="sequence_name" value="${mimer.getSequences.SEQUENCE_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-sequence-usageprivilege" icon="Privileges" label="Usage Privilege" viewer="grid">
            <Command idref="mimer.getObjectPrivileges">
               <Input name="object_schema" value="${mimer.getSequences.SEQUENCE_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getSequences.SEQUENCE_NAME}"/>
               <Input name="object_type" value="SEQUENCE"/>
               <Input name="privilege_type" value="USAGE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows usage privileges granted to, or by, the current user or groups he/she is a member of.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-sequence-sequenceusedby" icon="ObjectsUsed" label="Sequence used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${mimer.getSequences.SEQUENCE_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getSequences.SEQUENCE_NAME}"/>
               <Input name="object_type" value="SEQUENCE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the sequence owner, this view shows all database objects that uses the sequence.
For other users, the view only shows objects that uses the sequence that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <If test="#util.isDatabaseVersionLTE(9,2)">
         </If>
         <Else>
            <DataView id="mimer-sequence-sequenceuses" icon="ObjectsUsing" label="Sequence uses" viewer="grid">
               <Command idref="mimer.getObjectsUsing">
                  <Input name="object_schema" value="${schema}"/>
                  <Input name="object_name" value="${objectname}"/>
                  <Input name="object_type" value="SEQUENCE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
For the sequence owner, this view shows all database objects that are used by the function.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
               </Message>
            </DataView>
         </Else>
         <DataView id="mimer-sequence-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getSequenceSource">
               <Input name="sequence_schema" value="${mimer.getSequences.SEQUENCE_SCHEMA}"/>
               <Input name="sequence_name" value="${mimer.getSequences.SEQUENCE_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Functions">
         <DataView id="mimer-functions-functions" icon="Functions" label="Functions" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP FUNCTION Cascade">
                  <Input name="command" value="drop function ${schema||ROUTINE_SCHEMA}${object||ROUTINE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP FUNCTION Restrict">
               <Input name="command" value="drop function ${schema||ROUTINE_SCHEMA}${object||ROUTINE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getRoutines">
               <Input name="routinetype" value="FUNCTION"/>
               <Input name="specificname" value="%"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows all functions for the selected schema that the current user has access to.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-functions-functionfacts" icon="Comment" label="Function Facts" viewer="grid">
            <Command idref="mimer.getRoutineFacts">
               <Input name="routinetype" value="FUNCTION"/>
            </Command>
            <Message>
               <If test="#util.isDatabaseVersionGTE(10,1)">
                  <![CDATA[
<html>
This view shows detailed information for all functions for the selected schema that the current user has access to.<br/><br/>
<b>Implicit</b> functions are created when a user defined type is created.
</html>
                 ]]>
               </If>
               <Else>
                  <![CDATA[
<html>
This view shows detailed information for all functions for the selected schema that the current user has access to.
</html>
                 ]]>
               </Else>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Function">
         <DataView id="mimer-function-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getRoutineInfo"/>
         </DataView>
         <DataView id="mimer-function-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getRoutineParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-function-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getRoutineResult"/>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-function-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="FUNCTION"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-function-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="FUNCTION"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the function.
For other users, the view only shows objects that uses the function that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-function-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="FUNCTION"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the function owner, this view shows all database objects that are used by the function.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-function-functioneditor" classargs="FUNCTION" icon="SourceEditor" label="Function Editor" viewer="ProcedureViewer"
                   doclink="http://www.dbvis.com/doclink/edit-code-object">
         </DataView>
         <If test="! #util.isLicensed()">
            <DataView id="mimer-function-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="mimer.getObjectSource">
                  <Input name="schema" value="${schema}"/>
                  <Input name="specific_name" value="${specificname}"/>
                  <Input name="type" value="FUNCTION"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="BaseTypes">
         <DataView id="mimer-basetypes-basicdatatypes" icon="BaseTypes" label="Basic Data Types" viewer="grid">
            <Command idref="mimer.getDataTypesInfo">
               <Input name="type_categories" value="'DATA TYPE'"/>
               <Input name="type_name" value="%"/>
               <ProcessDataSet action="dropcolumn" index="DATA_TYPE"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="BaseType">
         <DataView id="mimer-basetype-info" icon="info" label="Info" viewer="form">
            <Command idref="mimer.getDataTypesInfo">
               <Input name="type_categories" value="'DATA TYPE'"/>
               <Input name="type_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="DistinctTypes">
         <DataView id="mimer-distincttypes-userdefineddistincttypes" icon="DistinctTypes" label="User Defined Distinct Types" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP TYPE Cascade">
                  <Input name="command" value="drop type ${schema||USER_DEFINED_TYPE_SCHEMA}${object||USER_DEFINED_TYPE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP TYPE Restrict">
               <Input name="command" value="drop type ${schema||USER_DEFINED_TYPE_SCHEMA}${object||USER_DEFINED_TYPE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getUserDefinedTypes">
               <Input name="userDefinedTypePattern" value="%"/>
               <Input name="userDefinedTypeCategory" value="DISTINCT"/>
               <ProcessDataSet action="dropcolumn" index="IS_INSTANTIABLE"/>
               <ProcessDataSet action="dropcolumn" index="IS_FINAL"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the <b>distinct</b> user defined types that are created in the current schema.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="StructuredTypes">
         <DataView id="mimer-structuredtypes-userstructureddistincttypes" icon="StructuredTypes" label="User Structured Distinct Types" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP TYPE Cascade">
                  <Input name="command" value="drop type ${schema||USER_DEFINED_TYPE_SCHEMA}${object||USER_DEFINED_TYPE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP TYPE Restrict">
               <Input name="command" value="drop type ${schema||USER_DEFINED_TYPE_SCHEMA}${object||USER_DEFINED_TYPE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getUserDefinedTypes">
               <Input name="userDefinedTypePattern" value="%"/>
               <Input name="userDefinedTypeCategory" value="STRUCTURED"/>
               <ProcessDataSet action="dropcolumn" index="DATA_TYPE"/>
               <ProcessDataSet action="dropcolumn" index="COLLATION_SCHEMA"/>
               <ProcessDataSet action="dropcolumn" index="COLLATION_NAME"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the <b>structured</b> user defined types that are created in the current schema.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Attributes">
         <DataView id="mimer-attributes-userdefinedtypeattributes" icon="Attributes" label="User Defined Type Attributes" viewer="grid">
            <Command idref="mimer.getUDTAttributes"/>
            <Message>
               <![CDATA[
<html>
This view shows the attributes for the <b>structured</b> user defined type.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Attribute">
         <DataView id="mimer-attribute-userdefinedtypeattribute" icon="Attribute" label="User Defined Type Attribute" viewer="form">
            <Command idref="mimer.getUDTAttributes"/>
            <Message>
               <![CDATA[
<html>
This view shows information about an attribute for a user defined type.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-attribute-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getAttributeSource"/>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="ConstructorMethods">
         <DataView id="mimer-constructormethods-constructormethods" icon="ConstructorMethods" label="Constructor Methods" viewer="grid">
            <Command idref="mimer.getUDTRoutinesAll">
               <Input name="routinetype" value="CONSTRUCTOR METHOD"/>
               <ProcessDataSet action="dropcolumn" index="COLLATION_SCHEMA"/>
               <ProcessDataSet action="dropcolumn" index="COLLATION_NAME"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the constructor methods used to create the selected user defined type.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="InstanceMethods">
         <DataView id="mimer-instancemethods-instancemethods" icon="InstanceMethods" label="Instance Methods" viewer="grid">
            <Command idref="mimer.getUDTRoutinesAll">
               <Input name="routinetype" value="INSTANCE METHOD"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the instance methods associated with the selected user defined type.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="StaticMethods">
         <DataView id="mimer-staticmethods-staticmethods" icon="StaticMethods" label="Static Methods" viewer="grid">
            <Command idref="mimer.getUDTRoutinesAll">
               <Input name="routinetype" value="STATIC METHOD"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the static methods associated with the selected user defined type.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="ConstructorMethodUndef">
         <DataView id="mimer-constructormethodundef-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getMethodInfo"/>
         </DataView>
         <DataView id="mimer-constructormethodundef-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getMethodParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethodundef-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getMethodResult"/>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethodundef-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="${routinetype}"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethodundef-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the method.
For other users, the view only shows objects that uses the method that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethodundef-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the method owner, this view shows all database objects that are used by the method.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethodundef-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getSpecificationSource">
               <Input name="schema" value="${schema}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="ConstructorMethod">
         <DataView id="mimer-constructormethod-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getRoutineInfo"/>
         </DataView>
         <DataView id="mimer-constructormethod-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getRoutineParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethod-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getRoutineResult">
               <Input name="routine_schema" value="${schema}"/>
               <Input name="routine_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethod-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="${routinetype}"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethod-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the method.
For other users, the view only shows objects that uses the method that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethod-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the method owner, this view shows all database objects that are used by the method.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-constructormethod-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getObjectSource">
               <Input name="schema" value="${schema}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="InstanceMethod">
         <DataView id="mimer-instancemethod-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getRoutineInfo"/>
         </DataView>
         <DataView id="mimer-instancemethod-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getRoutineParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethod-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getRoutineResult">
               <Input name="routine_schema" value="${schema}"/>
               <Input name="routine_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethod-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="${routinetype}"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethod-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the method.
For other users, the view only shows objects that uses the method that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethod-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the method owner, this view shows all database objects that are used by the method.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethod-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getObjectSource">
               <Input name="schema" value="${schema}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="InstanceMethodUndef">
         <DataView id="mimer-instancemethodundef-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getMethodInfo"/>
         </DataView>
         <DataView id="mimer-instancemethodundef-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getMethodParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethodundef-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getRoutineResult">
               <Input name="routine_schema" value="${schema}"/>
               <Input name="routine_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethodundef-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="${routinetype}"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethodundef-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the method.
For other users, the view only shows objects that uses the method that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethodundef-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the method owner, this view shows all database objects that are used by the method.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-instancemethodundef-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getSpecificationSource"/>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="StaticMethodUndef">
         <DataView id="mimer-staticmethodundef-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getMethodInfo"/>
         </DataView>
         <DataView id="mimer-staticmethodundef-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getMethodParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethodundef-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getMethodResult">
               <Input name="routine_schema" value="${schema}"/>
               <Input name="routine_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethodundef-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the method owner, this view shows all database objects that are used by the method.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethodundef-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getSpecificationSource"/>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="StaticMethod">
         <DataView id="mimer-staticmethod-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getMethodInfo"/>
         </DataView>
         <DataView id="mimer-staticmethod-parameters" icon="Input" label="Parameters" viewer="grid">
            <Command idref="mimer.getMethodParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethod-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getRoutineResult">
               <Input name="routine_schema" value="${schema}"/>
               <Input name="routine_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethod-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="${routinetype}"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethod-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the method.
For other users, the view only shows objects that uses the method that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethod-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the method owner, this view shows all database objects that are used by the method.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-staticmethod-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getObjectSource">
               <Input name="schema" value="${schema}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="type" value="${routinetype}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="ModuleFunction">
         <DataView id="mimer-modulefunction-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getRoutineInfo"/>
         </DataView>
         <DataView id="mimer-modulefunction-parameters" icon="Input" label="Parameters" viewer="form">
            <Command idref="mimer.getRoutineParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows the input parameters of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-modulefunction-result" icon="Output" label="Result" viewer="form">
            <Command idref="mimer.getRoutineResult"/>
            <Message>
               <![CDATA[
<html>
This view shows the return value of the function.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-modulefunction-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="FUNCTION"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-modulefunction-functionusedby" icon="ObjectsUsed" label="Function used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="FUNCTION"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the function owner, this view shows all database objects that uses the function.
For other users, the view only shows objects that uses the function that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-modulefunction-functionuses" icon="ObjectsUsing" label="Function uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="FUNCTION"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the function owner, this view shows all database objects that are used by the function.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-modulefunction-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getObjectSource">
               <Input name="schema" value="${schema}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="type" value="FUNCTION"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Procedures">
         <DataView id="generic-procedures-procedures" action="drop"/>

         <DataView id="mimer-procedures-procedures" icon="Procedures" label="Procedures" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP PROCEDURE Cascade">
                  <Input name="command" value="drop procedure ${schema||ROUTINE_SCHEMA}${object||ROUTINE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP PROCEDURE Restrict">
               <Input name="command" value="drop procedure ${schema||ROUTINE_SCHEMA}${object||ROUTINE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getRoutines">
               <Input name="routinetype" value="PROCEDURE"/>
               <Input name="specificname" value="%"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows all procedures for the selected schema that the current user has access to.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-procedures-procedurefacts" icon="Comment" label="Procedure Facts" viewer="grid">
            <Command idref="mimer.getRoutineFacts">
               <Input name="routinetype" value="PROCEDURE"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Input">
         <DataView id="mimer-input-parameter" icon="Input" label="Parameter" viewer="node-form">
            <Command idref="mimer.getRoutineParameters"/>
            <Message>
               <![CDATA[
<html>
This view shows information about an individual function/procedure parameter.
</html>
            ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Output">
         <DataView id="mimer-output-result" icon="Output" label="Result" viewer="node-form">
            <Command idref="mimer.getRoutineResult"/>
            <Message>
               <![CDATA[
<html>
This view shows information about the value returned by the function.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Procedure">
         <DataView id="generic-procedure-columns" action="drop"/>

         <DataView id="mimer-procedure-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getRoutineInfo"/>
         </DataView>
         <DataView id="mimer-procedure-parameters" icon="Input" label="Parameters" viewer="form">
            <Command idref="mimer.getRoutineParameters"/>
         </DataView>
         <DataView id="mimer-procedure-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="PROCEDURE"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-procedure-procedureusedby" icon="ObjectsUsed" label="Procedure used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="PROCEDURE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the procedure owner, this view shows all database objects that uses the procedure.
For other users, the view only shows objects that uses the procedure that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-procedure-procedureuses" icon="ObjectsUsing" label="Procedure uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="PROCEDURE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the procedure owner, this view shows all database objects that are used by the procedure.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-procedure-procedureeditor"
                   classargs="PROCEDURE"
                   icon="SourceEditor"
                   label="Procedure Editor"
                   viewer="ProcedureViewer"
                   doclink="http://www.dbvis.com/doclink/edit-code-object"/>
         <If test="! #util.isLicensed()">
            <DataView id="mimer-procedure-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="mimer.getObjectSource">
                  <Input name="schema" value="${schema}"/>
                  <Input name="specific_name" value="${specificname}"/>
                  <Input name="type" value="PROCEDURE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="ModuleProcedure">
         <DataView id="mimer-moduleprocedure-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getRoutineInfo"/>
         </DataView>
         <DataView id="mimer-moduleprocedure-parameters" icon="Input" label="Parameters" viewer="form">
            <Command idref="mimer.getRoutineParameters"/>
         </DataView>
         <DataView id="mimer-moduleprocedure-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
            <Command idref="mimer.getRoutinePrivileges">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="object_type" value="PROCEDURE"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-moduleprocedure-procedureusedby" icon="ObjectsUsed" label="Procedure used by" viewer="grid">
            <Command idref="mimer.getObjectsUsed">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="PROCEDURE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the procedure owner, this view shows all database objects that uses the procedure.
For other users, the view only shows objects that uses the procedure that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-moduleprocedure-procedureuses" icon="ObjectsUsing" label="Procedure uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${schema}"/>
               <Input name="object_name" value="${objectname}"/>
               <Input name="object_type" value="PROCEDURE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the procedure owner, this view shows all database objects that are used by the procedure.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-moduleprocedure-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getObjectSource">
               <Input name="schema" value="${schema}"/>
               <Input name="specific_name" value="${specificname}"/>
               <Input name="type" value="PROCEDURE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object for the creator of the view.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Modules">
         <DataView id="mimer-modules-modules" icon="Modules" label="Modules" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP MODULE Cascade">
                  <Input name="command" value="drop module ${schema||MODULE_SCHEMA}${object||MODULE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP MODULE Restrict">
               <Input name="command" value="drop module ${schema||MODULE_SCHEMA}${object||MODULE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getModules">
               <Input name="module_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows modules created by the current user.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-modules-modulefacts" icon="Comment" label="Module Facts" viewer="grid">
            <Command idref="mimer.getModuleFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Module">
         <DataView id="mimer-module-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getModuleInfo">
               <Input name="module_schema" value="${mimer.getModules.MODULE_SCHEMA}"/>
               <Input name="module_name" value="${mimer.getModules.MODULE_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-module-moduleroutines" icon="Procedure" label="Module routines" viewer="grid">
            <Command idref="mimer.getModuleRoutines">
               <Input name="module_schema" value="${mimer.getModules.MODULE_SCHEMA}"/>
               <Input name="module_name" value="${mimer.getModules.MODULE_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-module-moduleeditor" classargs="PACKAGE BODY"  icon="SourceEditor" label="Module Editor" viewer="ProcedureViewer"
                   doclink="http://www.dbvis.com/doclink/edit-code-object">
         </DataView>
         <If test="! #util.isLicensed()">
            <DataView id="mimer-module-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="mimer.getObjectSourceByName">
                  <Input name="object_schema" value="${mimer.getModules.MODULE_SCHEMA}"/>
                  <Input name="object_name" value="${mimer.getModules.MODULE_NAME}"/>
                  <Input name="object_type" value="MODULE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Types">
         <DataView id="mimer-types-userdefinedtypes" icon="Types" label="User Defined Types" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP TYPE Cascade">
                  <Input name="command" value="drop type ${schema||USER_DEFINED_TYPE_SCHEMA}${object||USER_DEFINED_TYPE_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP TYPE Restrict">
               <Input name="command" value="drop type ${schema||USER_DEFINED_TYPE_SCHEMA}${object||USER_DEFINED_TYPE_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getUserDefinedTypes">
               <Input name="userDefinedTypeCategory" value="%"/>
               <Input name="userDefinedTypePattern" value="%"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows user defined types for the selected schema that are accessible to the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <!--<DataView type="Comment" label="User Defined Type Facts" viewer="grid">
        <Command idref="mimer.getUserDefinedTypeFacts"/>
      </DataView>-->
      </ObjectView>

      <ObjectView type="DistinctType">
         <DataView id="mimer-distincttype-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getUserDefinedTypes">
               <Input name="userDefinedTypePattern" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="mimer-distincttype-usageprivilege" icon="Privileges" label="Usage Privilege" viewer="grid">
            <Command idref="mimer.getUDTPrivileges"/>
            <Message>
               <![CDATA[
<html>
This view shows usage privileges granted to, or by, the current user or groups he/she is a member of.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-distincttype-userdefinedtypeusedby" icon="ObjectsUsed" label="User Defined Type Used By" viewer="grid">
            <Command idref="mimer.getUDTUsed"/>
            <Message>
               <![CDATA[
<html>
If the current user is the user defined type owner, this view shows all database objects that uses the type.
For other users, the view only shows objects that uses the user defined type that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-distincttype-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getUDTSource"/>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object. Only the creator of the object can see the definition.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="StructuredType">
         <DataView id="mimer-structuredtype-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getUserDefinedTypes">
               <Input name="userDefinedTypePattern" value="${objectname}"/>
               <!-- The following columns are always NULL for structured types -->
               <ProcessDataSet action="dropcolumn" index="ORDERING_ROUTINE_SCHEMA"/>
               <ProcessDataSet action="dropcolumn" index="ORDERING_ROUTINE_NAME"/>
               <ProcessDataSet action="dropcolumn" index="DATA_TYPE"/>
               <ProcessDataSet action="dropcolumn" index="COLLATION_SCHEMA"/>
               <ProcessDataSet action="dropcolumn" index="COLLATION_NAME"/>
            </Command>
         </DataView>
         <DataView id="mimer-structuredtype-usageprivilege" icon="Privileges" label="Usage Privilege" viewer="grid">
            <Command idref="mimer.getUDTPrivileges"/>
            <Message>
               <![CDATA[
<html>
This view shows usage privileges granted to, or by, the current user or groups he/she is a member of.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-structuredtype-userdefinedtypeusedby" icon="ObjectsUsed" label="User Defined Type Used By" viewer="grid">
            <Command idref="mimer.getUDTUsed"/>
            <Message>
               <![CDATA[
<html>
If the current user is the user defined type owner, this view shows all database objects that uses the type.
For other users, the view only shows objects that uses the user defined type that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-structuredtype-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getUDTSource"/>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object. Only the creator of the object can see the definition.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Triggers">
         <DataView id="mimer-triggers-triggers" icon="Triggers" label="Triggers" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP TRIGGER Cascade">
                  <Input name="command" value="drop trigger ${schema||TRIGGER_SCHEMA}${object||TRIGGER_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP TRIGGER Restrict">
               <Input name="command" value="drop trigger ${schema||TRIGGER_SCHEMA}${object||TRIGGER_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getTriggers">
               <Input name="trigger_schema" value="${schema}"/>
               <Input name="tableNamePattern" value="${theTableName}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows table triggers and instead-of triggers for views created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-triggers-triggerfacts" icon="Comment" label="Trigger Facts" viewer="grid">
            <Command idref="mimer.getTriggerFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Trigger">
         <DataView id="mimer-trigger-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getTriggerInfo">
               <Input name="trigger_schema" value="${mimer.getTriggers.TRIGGER_SCHEMA}"/>
               <Input name="trigger_name" value="${mimer.getTriggers.TRIGGER_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-trigger-triggeruses" icon="ObjectsUsing" label="Trigger uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${mimer.getTriggers.TRIGGER_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getTriggers.TRIGGER_NAME}"/>
               <Input name="object_type" value="TRIGGER"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows all database objects that are used by the trigger.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-trigger-triggereditor" classargs="TRIGGER" icon="SourceEditor" label="Trigger Editor" viewer="ProcedureViewer"
                   doclink="http://www.dbvis.com/doclink/edit-code-object">
         </DataView>
         <If test="! #util.isLicensed()">
            <DataView id="mimer-trigger-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="mimer.getObjectSourceByName">
                  <Input name="object_schema" value="${mimer.getTriggers.TRIGGER_SCHEMA}"/>
                  <Input name="object_name" value="${mimer.getTriggers.TRIGGER_NAME}"/>
                  <Input name="object_type" value="TRIGGER"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Domains">
         <DataView id="mimer-domains-domains" icon="Domains" label="Domains" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP DOMAIN Cascade">
                  <Input name="command" value="drop domain ${schema||DOMAIN_SCHEMA}${object||DOMAIN_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP DOMAIN Restrict">
               <Input name="command" value="drop domain ${schema||DOMAIN_SCHEMA}${object||DOMAIN_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getDomains">
               <Input name="domain_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows domains for the selected schema that are accessible to the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-domains-domainfacts" icon="Comment" label="Domain Facts" viewer="grid">
            <Command idref="mimer.getDomainFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Domain">
         <DataView id="mimer-domain-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getDomainInfo">
               <Input name="domain_schema" value="${mimer.getDomains.DOMAIN_SCHEMA}"/>
               <Input name="domain_name" value="${mimer.getDomains.DOMAIN_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-domain-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="mimer.getDomainConstraints">
               <Input name="domain_schema" value="${mimer.getDomains.DOMAIN_SCHEMA}"/>
               <Input name="domain_name" value="${mimer.getDomains.DOMAIN_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows constraints if the domain is created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-domain-usageprivilege" icon="Privileges" label="Usage Privilege" viewer="grid">
            <Command idref="mimer.getObjectPrivileges">
               <Input name="object_schema" value="${mimer.getDomains.DOMAIN_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getDomains.DOMAIN_NAME}"/>
               <Input name="object_type" value="DOMAIN"/>
               <Input name="privilege_type" value="USAGE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows usage privileges granted to, or by, the current user or groups he/she is a member of.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-domain-domainusedby" icon="ObjectsUsed" label="Domain used by" viewer="grid">
            <Command idref="mimer.getDomainUsed">
               <Input name="object_schema" value="${mimer.getDomains.DOMAIN_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getDomains.DOMAIN_NAME}"/>
               <Input name="object_type" value="DOMAIN"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the domain owner, this view shows all database objects that uses the domain.
For other users, the view only shows objects that uses the domain that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-domain-domainuses" icon="ObjectsUsing" label="Domain uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${mimer.getDomains.DOMAIN_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getDomains.DOMAIN_NAME}"/>
               <Input name="object_type" value="DOMAIN"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the domain owner, this view shows all database objects that are used by the domain.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-domain-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getDomainSource">
               <Input name="domain_schema" value="${mimer.getDomains.DOMAIN_SCHEMA}"/>
               <Input name="domain_name" value="${mimer.getDomains.DOMAIN_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object. Only the creator of the object can see constraints.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Collations">
         <DataView id="mimer-collations-collations" icon="Collations" label="Collations" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP COLLATION Cascade">
                  <Input name="command" value="drop COLLATION ${schema||COLLATION_SCHEMA}${object||COLLATION_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP COLLATION Restrict">
               <Input name="command" value="drop COLLATION ${schema||COLLATION_SCHEMA}${object||COLLATION_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getCollations">
               <Input name="collation_schema" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows collations that the current user is allowed to use.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-collations-collationfacts" icon="Comment" label="Collation Facts" viewer="grid">
            <Command idref="mimer.getCollationFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Collation">
         <DataView id="mimer-collation-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getCollationInfo">
               <Input name="collation_schema" value="${mimer.getCollations.COLLATION_SCHEMA}"/>
               <Input name="collation_name" value="${mimer.getCollations.COLLATION_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows collations the current user is allowed to use.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-collation-usageprivilege" icon="Privileges" label="Usage Privilege" viewer="grid">
            <Command idref="mimer.getObjectPrivileges">
               <Input name="object_schema" value="${mimer.getCollations.COLLATION_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getCollations.COLLATION_NAME}"/>
               <Input name="object_type" value="COLLATION"/>
               <Input name="privilege_type" value="USAGE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows usage privileges granted to, or by, the current user or groups he/she is a member of.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-collation-collationusedby" icon="ObjectsUsed" label="Collation used by" viewer="grid">
            <Command idref="mimer.getCollationUsed">
               <Input name="object_schema" value="${mimer.getCollations.COLLATION_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getCollations.COLLATION_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the collation owner, this view shows all database objects that uses the collation.
For other users, the view only shows objects that uses the collation that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-collation-collationuses" icon="ObjectsUsing" label="Collation uses" viewer="grid">
            <Command idref="mimer.getObjectsUsing">
               <Input name="object_schema" value="${mimer.getCollations.COLLATION_SCHEMA}"/>
               <Input name="object_name" value="${mimer.getCollations.COLLATION_NAME}"/>
               <Input name="object_type" value="COLLATION"/>
            </Command>
            <Message>
               <![CDATA[
<html>
For the collation owner, this view shows all database objects that are used by the collation.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <!-- No collation command in 9.1 of Mimer SQL, introduced in 9.2... -->
         <!-- Test needs to be this way if getDatabaseMajorVersion not supported (JDBC1,2 driver) -->
         <If test="#util.isDatabaseVersionLTE(9,1)">
         </If>
         <Else>
            <!-- Version 9.2 or later -->
            <DataView id="mimer-collation-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="mimer.getCollationSource">
                  <Input name="collation_schema" value="${mimer.getCollations.COLLATION_SCHEMA}"/>
                  <Input name="collation_name" value="${mimer.getCollations.COLLATION_NAME}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </Else>
      </ObjectView>

      <!-- Test needs to be this way if getDatabaseMajorVersion not supported (JDBC1,2 driver) -->
      <If test="#util.isDatabaseVersionLT(9)">
      </If>
      <Else>
         <If test="#dm.getDatabaseProductName().equals('Mimer SQL Mobile') or #dm.getDatabaseProductName().equals('Mimer SQL Micro')">
            <!--  Mimer SQL Mobile -->
            <ObjectView type="Statements">
               <DataView id="mimer-statements-statements" icon="Statements" label="Statements" viewer="grid">
                  <Command idref="mimer.getMobileStatements">
                     <ProcessDataSet action="dropcolumn" index="STATEMENT_TYPE"/>
                  </Command>
                  <Message>
                     <![CDATA[
<html>
This view shows statements for the selected schema that are accessible to the current user.
</html>
                 ]]>
                  </Message>
               </DataView>
            </ObjectView>
            <!-- We have no way of displaying information about the individual statement/BG
        <ObjectView type="Statement">
          <DataView type="Info" label="Info" viewer="form">
            <Command idref="mimer.getMobileStatements"/>
          </DataView>
        </ObjectView>-->
         </If>
         <Else>
            <!--  Mimer SQL Engine -->
            <ObjectView type="Statements">
               <DataView id="mimer-statements-statements" icon="Statements" label="Statements" viewer="grid">
                  <Input name="menuItem" value="Script: DROP STATEMENT">
                     <Input name="command" value="drop statement ${schema||STATEMENT_SCHEMA}${object||STATEMENT_NAME}"/>
                  </Input>
                  <Command idref="mimer.getStatements">
                     <Input name="statement_schema" value="${schema}"/>
                     <Input name="statement_name" value="%"/>
                  </Command>
                  <Message>
                     <![CDATA[
<html>
This view shows statements for the selected schema that are accessible to the current user.
</html>
                 ]]>
                  </Message>
               </DataView>
               <DataView id="mimer-statements-statementfacts" icon="Comment" label="Statement Facts" viewer="grid">
                  <Command idref="mimer.getStatementFacts"/>
               </DataView>
            </ObjectView>

            <ObjectView type="Statement">
               <DataView id="mimer-statement-info" icon="Info" label="Info" viewer="form">
                  <Command idref="mimer.getStatementInfo">
                     <Input name="statement_schema" value="${mimer.getStatements.STATEMENT_SCHEMA}"/>
                     <Input name="statement_name" value="${mimer.getStatements.STATEMENT_NAME}"/>
                  </Command>
               </DataView>
               <DataView id="mimer-statement-executeprivilege" icon="Privileges" label="Execute Privilege" viewer="grid">
                  <Command idref="mimer.getObjectPrivileges">
                     <Input name="object_schema" value="${mimer.getStatements.STATEMENT_SCHEMA}"/>
                     <Input name="object_name" value="${mimer.getStatements.STATEMENT_NAME}"/>
                     <Input name="object_type" value="STATEMENT"/>
                     <Input name="privilege_type" value="EXECUTE"/>
                  </Command>
                  <Message>
                     <![CDATA[
<html>
This view shows execute privileges granted to, or by, the current user or groups he/she is a member of.
</html>
                    ]]>
                  </Message>
               </DataView>
               <!--  Currently statements are not referenced by other objects
               <DataView type="ObjectsUsed" label="Statement used by" viewer="grid">
                  <Command idref="mimer.getObjectsUsed">
                        <Input name="object_schema" value="${mimer.getStatements.STATEMENT_SCHEMA}"/>
                        <Input name="object_name" value="${mimer.getStatements.STATEMENT_NAME}"/>
                        <Input name="object_type" value="STATEMENT"/>
                  </Command>
               </DataView>
               -->
               <DataView id="mimer-statement-statementuses" icon="ObjectsUsing" label="Statement uses" viewer="grid">
                  <Command idref="mimer.getObjectsUsing">
                     <Input name="object_schema" value="${mimer.getStatements.STATEMENT_SCHEMA}"/>
                     <Input name="object_name" value="${mimer.getStatements.STATEMENT_NAME}"/>
                     <Input name="object_type" value="STATEMENT"/>
                  </Command>
                  <Message>
                     <![CDATA[
<html>
For the statement owner, this view shows all database objects that are used by the statement.
For other users, the view only shows used objects created by the current user.
</html>
                 ]]>
                  </Message>
               </DataView>
               <DataView id="mimer-statement-ddl" icon="Source" label="DDL" viewer="text">
                  <Command idref="mimer.getStatementSource">
                     <Input name="statement_schema" value="${mimer.getStatements.STATEMENT_SCHEMA}"/>
                     <Input name="statement_name" value="${mimer.getStatements.STATEMENT_NAME}"/>
                  </Command>
                  <Message>
                     <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
                  </Message>
               </DataView>
            </ObjectView>
         </Else>
      </Else>

      <ObjectView type="Properties">
         <DataView id="mimer-properties-sessionproperties" icon="Properties" label="Session Properties" viewer="grid">
            <Command idref="mimer.getSessionProperties"/>
            <Message>
               <![CDATA[
<html>
This view shows various properties for this database session.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-properties-systemprivileges" icon="Privileges" label="System Privileges" viewer="grid">
            <Command idref="mimer.getSystemPrivileges">
               <Input name="grantee" value="CURRENT_USER"/>
               <ProcessDataSet action="dropcolumn" index="IS_GRANTABLE"/>
               <ProcessDataSet action="dropcolumn" index="GRANTOR"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows system privileges granted to the current user.
</html>
           ]]>
            </Message>
         </DataView>

         <DataView id="mimer-properties-groupmemberships" icon="Groups" label="Group memberships" viewer="grid">
            <Command idref="mimer.getCurrentGroups"/>
            <Message>
               <![CDATA[
<html>
This view shows groups where the current user is a member.
</html>
           ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Locks">
         <DataView id="mimer-auto-properties" icon="properties" label="Mimer SQL Auto" viewer="message">
            <Message>
               <![CDATA[
<html>
Mimer SQL Auto database server type has no capabilities to list the contents of the database schema.<br/><br/>
Please enter the precompiled statement names in the command window to perform operations
towards the database.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <!-- DBA views -->

      <ObjectView type="DBA">
         <DataView id="mimer-dba-databaseproperties" icon="properties" label="Database Properties" viewer="grid">
            <Command idref="mimer.getServerInfo"/>
            <Message>
               <![CDATA[
<html>
For users with access to SYSTEM.SERVER_INFO this view shows various database attributes.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Users">
         <DataView id="mimer-users-users" icon="Users" label="Users" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP IDENT Cascade">
                  <Input name="command" value="drop ident ${object||IDENT_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP IDENT Restrict">
               <Input name="command" value="drop ident ${object||IDENT_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getIdents">
               <Input name="ident_type" value="'USER','OS_USER'"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the current user and users created by the current user.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-users-userfacts" icon="Comment" label="User Facts" viewer="grid">
            <Command idref="mimer.getIdentFacts">
               <Input name="ident_type" value="'USER','OS_USER'"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="User">
         <DataView id="mimer-user-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getIdentInfo">
               <Input name="ident_type" value="${mimer.getIdents.IDENT_TYPE}"/>
               <Input name="ident_name" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(10,1)">
            <DataView id="mimer-user-osusers" icon="Osusers" label="OS users" viewer="grid">
               <Command idref="mimer.getOsUsersForIdent">
                  <Input name="objectname" value="${mimer.getIdents.IDENT_NAME}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows operating system users that can log into the Mimer SQL user without specifying a password.
</html>
                  ]]>
               </Message>
            </DataView>
         </If>
         <DataView id="mimer-user-schemas" icon="Schemas" label="Schemas" viewer="grid">
            <Command idref="mimer.getIdentSchemas">
               <Input name="ident_name" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows schemas owned by the selected user. Only schema owners can view this information.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-user-accessrights" icon="Privileges" label="Access rights" viewer="grid">
            <Command idref="mimer.getTablePrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows access rights granted to the selected user that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-user-columnprivileges" icon="Privileges" label="Column Privileges" viewer="grid">
            <Command idref="mimer.getColumnPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows column priviliges granted to the selected user that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-user-objectprivileges" icon="Privileges" label="Object Privileges" viewer="grid">
            <Command idref="mimer.getIdentObjectPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="privilege_type" value="EXECUTE','SEQUENCE','TABLE','USAGE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows object privileges granted to the selected user that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-user-systemprivileges" icon="Privileges" label="System Privileges" viewer="grid">
            <Command idref="mimer.getSystemPrivileges">
               <Input name="grantee" value="'${mimer.getIdents.IDENT_NAME}'"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows system privileges granted to the selected user that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-user-groupmemberships" icon="Groups" label="Group memberships" viewer="form">
            <Command idref="mimer.getIdentObjectPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="privilege_type" value="MEMBER"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows groups where the selected user is a member that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-user-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getIdentSource">
               <Input name="ident" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
           ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Programs">
         <DataView id="mimer-programs-programs" icon="Programs" label="Programs" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP IDENT Cascade">
                  <Input name="command" value="drop ident ${object||IDENT_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP IDENT Restrict">
               <Input name="command" value="drop ident ${object||IDENT_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getIdents">
               <Input name="ident_type" value="'PROGRAM'"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows programs that the current user has <b>execute</b> access on.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-programs-programfacts" icon="Comment" label="Program Facts" viewer="grid">
            <Command idref="mimer.getIdentFacts">
               <Input name="ident_type" value="'PROGRAM'"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Program">
         <DataView id="mimer-program-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getIdentInfo">
               <Input name="ident_type" value="${mimer.getIdents.IDENT_TYPE}"/>
               <Input name="ident_name" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-program-execute" icon="Privileges" label="Execute" viewer="form">
            <Command idref="mimer.getObjectPrivileges">
               <Input name="object_schema" value="${mimer.getIdents.IDENT_CREATOR}"/>
               <Input name="object_name" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="object_type" value="IDENT"/>
               <Input name="privilege_type" value="EXECUTE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows granted execute privileges on the selected program that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-schemas" icon="Schemas" label="Schemas" viewer="grid">
            <Command idref="mimer.getIdentSchemas">
               <Input name="ident_name" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows schemas created by the selected program. Only schema owners can view this information.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-accessrights" icon="Privileges" label="Access rights" viewer="grid">
            <Command idref="mimer.getTablePrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows access rights for all objects granted to the program that the current user is allowed to see.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-columnprivileges" icon="Privileges" label="Column Privileges" viewer="grid">
            <Command idref="mimer.getColumnPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows column priviliges granted to the selected program that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-objectprivileges" icon="Privileges" label="Object Privileges" viewer="grid">
            <Command idref="mimer.getIdentObjectPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="privilege_type" value="EXECUTE','SEQUENCE','TABLE','USAGE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows object privileges granted to the selected user that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-systemprivileges" icon="Privileges" label="System Privileges" viewer="grid">
            <Command idref="mimer.getSystemPrivileges">
               <Input name="grantee" value="'${mimer.getIdents.IDENT_NAME}'"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows system privileges granted to the selected program that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-groupmemberships" icon="Groups" label="Group memberships" viewer="form">
            <Command idref="mimer.getIdentObjectPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="privilege_type" value="MEMBER"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows groups where the selected program is a member that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-program-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getIdentSource">
               <Input name="ident" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Groups">
         <DataView id="mimer-groups-groups" icon="Groups" label="Groups" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP IDENT Cascade">
                  <Input name="command" value="drop ident ${object||IDENT_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP IDENT Restrict">
               <Input name="command" value="drop ident ${object||IDENT_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getIdents">
               <Input name="ident_type" value="'GROUP'"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows groups that the current user is a member in.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-groups-groupfacts" icon="Comment" label="Group Facts" viewer="grid">
            <Command idref="mimer.getIdentFacts">
               <Input name="ident_type" value="'GROUP'"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Group">
         <DataView id="mimer-group-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getIdentInfo">
               <Input name="ident_type" value="${mimer.getIdents.IDENT_TYPE}"/>
               <Input name="ident_name" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-group-members" icon="Group" label="Members" viewer="form">
            <Command idref="mimer.getObjectPrivileges">
               <Input name="object_schema" value="${mimer.getIdents.IDENT_CREATOR}"/>
               <Input name="object_name" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="object_type" value="IDENT"/>
               <Input name="privilege_type" value="MEMBER"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows member in the selected group that the current user is allowed to see.
</html>
             ]]>
            </Message>
         </DataView>
         <DataView id="mimer-group-accessrights" icon="Privileges" label="Access rights" viewer="grid">
            <Command idref="mimer.getTablePrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows access rights granted to the group that the current user is allowed to see.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="mimer-group-columnprivileges" icon="Privileges" label="Column Privileges" viewer="grid">
            <Command idref="mimer.getColumnPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows column priviliges granted to the group that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-group-objectprivileges" icon="Privileges" label="Object Privileges" viewer="grid">
            <Command idref="mimer.getIdentObjectPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="privilege_type" value="EXECUTE','SEQUENCE','TABLE','USAGE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows object privileges granted to the selected user that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-group-systemprivileges" icon="Privileges" label="System Privileges" viewer="grid">
            <Command idref="mimer.getSystemPrivileges">
               <Input name="grantee" value="'${mimer.getIdents.IDENT_NAME}'"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows system privileges granted to the selected group that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-group-groupmemberships" icon="Groups" label="Group memberships" viewer="form">
            <Command idref="mimer.getIdentObjectPrivileges">
               <Input name="grantee" value="${mimer.getIdents.IDENT_NAME}"/>
               <Input name="privilege_type" value="MEMBER"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows groups where the selected group is a member that the current user is allowed to see.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-group-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getIdentSource">
               <Input name="ident" value="${mimer.getIdents.IDENT_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Databanks">
         <DataView id="mimer-databanks-databanks" icon="Databanks" label="Databanks" viewer="grid">
            <If test='#cp.getProperty("ConnectionMode") neq "Production"'>
               <Input name="menuItem" value="Script: DROP DATABANK Cascade">
                  <Input name="command" value="drop databank ${object||DATABANK_NAME} cascade"/>
               </Input>
            </If>
            <Input name="menuItem" value="Script: DROP DATABANK Restrict">
               <Input name="command" value="drop databank ${object||DATABANK_NAME} restrict"/>
            </Input>
            <Command idref="mimer.getDatabanks"/>
            <Message>
               <![CDATA[
<html>
This view shows databanks the current user has <b>table</b> privilege on. All databanks are shown if the user has system privilege <b>backup</b> or <b>shadow</b>.
</html>
           ]]>
            </Message>
         </DataView>
         <DataView id="mimer-databanks-databankfacts" icon="Comment" label="Databank Facts" viewer="grid">
            <Command idref="mimer.getDatabankFacts"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Databank">
         <DataView id="mimer-databank-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getDatabankInfo">
               <Input name="databank_name" value="${mimer.getDatabanks.DATABANK_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-databank-databankusedby" icon="ObjectsUsed" label="Databank used by" viewer="grid">
            <Command idref="mimer.getObjectsInDatabank">
               <Input name="databank_name" value="${mimer.getDatabanks.DATABANK_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
If the current user is the databank owner, this view shows all database objects that uses the databank.
For other users, the view only shows objects that uses the databank that are created by the current user.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="mimer-databank-objectprivilege" icon="Privileges" label="Object Privilege" viewer="grid">
            <Command idref="mimer.getObjectPrivileges">
               <Input name="object_schema" value="${mimer.getDatabanks.DATABANK_CREATOR}"/>
               <Input name="object_name" value="${mimer.getDatabanks.DATABANK_NAME}"/>
               <Input name="object_type" value="DATABANK"/>
               <Input name="privilege_type" value="SEQUENCE','TABLE"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows table privileges granted to, or by, the current user or groups he/she is a member of.
</html>
              ]]>
            </Message>
         </DataView>
         <DataView id="mimer-databank-shadows" icon="Shadows" label="Shadows" viewer="grid">
            <Command idref="mimer.getShadowsForDatabank">
               <Input name="databank_name" value="${mimer.getDatabanks.DATABANK_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-databank-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getDatabankSource">
               <Input name="databank_name" value="${mimer.getDatabanks.DATABANK_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
                 ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Shadows">
         <DataView id="mimer-shadows-shadows" icon="Shadows" label="Shadows" viewer="grid">
            <Input name="menuItem" value="Script: DROP SHADOW">
               <Input name="command" value="drop shadow ${object||SHADOW_NAME}"/>
            </Input>
            <Command idref="mimer.getShadows"/>
            <Message>
               <![CDATA[
<html>
This view shows shadows where the current user has created the databank. All shadows are shown if the user has system privilege <b>backup</b> or <b>shadow</b>.
</html>
           ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Shadow">
         <DataView id="mimer-shadow-info" icon="Info" label="Info" viewer="form">
            <Command idref="mimer.getShadowInfo">
               <Input name="shadow_name" value="${mimer.getShadows.SHADOW_NAME}"/>
            </Command>
         </DataView>
         <DataView id="mimer-shadow-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="mimer.getShadowSource">
               <Input name="shadow_name" value="${mimer.getShadows.SHADOW_NAME}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete data definition language statement used to create the object.
</html>
]]>
            </Message>
         </DataView>
      </ObjectView>

      <If test="#util.isDatabaseVersionLT(9,3)">
      </If>
      <Else>
         <ObjectView type="Subscriptions">
            <DataView id="mimer-subscriptions-subscriptions" icon="Subscriptions" label="Subscriptions" viewer="grid">
               <Command idref="mimer.getSubscriptions"/>
               <Message>
                  <![CDATA[
<html>
If replication has been activated, this view shows all subscriptions.
</html>
]]>
               </Message>
            </DataView>
         </ObjectView>

         <ObjectView type="Subscription">
            <DataView id="mimer-subscription-info" icon="Info" label="Info" viewer="form">
               <Command idref="mimer.getSubscriptionInfo"/>
            </DataView>
         </ObjectView>
      </Else>

      <!-- SQL Standard views -->
      <ObjectView type="SqlStandards">
         <DataView id="mimer-sqlstandards-sqlstandards" icon="SqlStandards" label="SQL Standards" viewer="grid">
            <Command idref="mimer.getSqlStandards">
               <Input name="table" value="INFORMATION_SCHEMA.SQL_FEATURES"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SqlStandard2003">
         <DataView id="mimer-sqlstandard2003-sql1999and2003features" icon="SqlStandard" label="SQL 1999 and 2003 features" viewer="grid">
            <Command idref="mimer.getSqlStandard">
               <Input name="table" value="INFORMATION_SCHEMA.SQL_FEATURES"/>
            </Command>
         </DataView>
         <DataView id="mimer-sqlstandard2003-sql1999and2003sizing" icon="SqlStandard" label="SQL 1999 and 2003 sizing" viewer="grid">
            <Command idref="mimer.getSqlStandard">
               <Input name="table" value="INFORMATION_SCHEMA.SQL_SIZING"/>
            </Command>
         </DataView>
         <DataView id="mimer-sqlstandard2003-sql1999and2003languages" icon="SqlStandard" label="SQL 1999 and 2003 languages" viewer="grid">
            <Command idref="mimer.getSqlStandard">
               <Input name="table" value="INFORMATION_SCHEMA.SQL_LANGUAGES"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SqlStandard1992">
         <DataView id="mimer-sqlstandard1992-sql1992features" icon="SqlStandard" label="SQL 1992 features" viewer="grid">
            <Command idref="mimer.getSqlStandard">
               <Input name="table" value="FIPS_DOCUMENTATION.SQL_FEATURES"/>
            </Command>
         </DataView>
         <DataView id="mimer-sqlstandard1992-sql1992sizing" icon="SqlStandard" label="SQL 1992 sizing" viewer="grid">
            <Command idref="mimer.getSqlStandard">
               <Input name="table" value="FIPS_DOCUMENTATION.SQL_SIZING"/>
            </Command>
         </DataView>
      </ObjectView>

   </ObjectsViewDef>

</DatabaseProfile>
