Special case: Schema and table name

Extraction of tables located in a database schema other than that of the user logged in is possible in the JDBC extractor only via a prefix of the table name. The prefix is separated by a period from the table name in the tablename attribute in the various elements of the table configuration (jdbc_tableconfiguration.dtd).

Example

<doctable name="customer" tablename="USER1.CUSTOMER ">

Since the period can also occur as a special character in schema and table names, each period that is part of the schema or table name must be masked with a backslash \. To recognize backslashes that are part of the name they must be masked by a double occurrence.

Schema and table names can be unambiguously differentiated in the following example configurations.

Schema name

Table name

Syntax for tablename attribute

USER

1.CUSTOMER

USER.1\.CUSTOMER

USER.1.1

ORDER.DE

USER\.1\.1.ORDER\.DE

USER.

ORDER

USER\..ORDER

USER\2

ORDER.DE

USER\\2.ORDER\.DE

USER\.1

ORDER\.44

USER\\\.1.ORDER\\\.44

USER

1.TABLE.1

USER.1.TABLE.1

If more than one period occurs in a schema and table name (see example in the last table row) which is not masked by the backslash, the first period is interpreted as a schema separator and the other periods are seen as parts of the table name. This corresponds to version pre-9.9 behavior and is kept for compatibility reasons. It is still recommended to mask all periods except the schema separator with a prefix backslash.

Masking any other character than period or backslash is not allowed.

When defining foreign keys it is important to observe that the value in the <fktablename> XML attribute refers to the <name> XML attribute and not to <tablename>.

Example

<jdbc_tableconfiguration>

<configuration name="Example">

<docspec>

<doctable name="USER.1.CUSTOMER" tablename="USER\.1.CUSTOMER">

<condition fieldname="SEQUENCE" logicaloperator="in">

<value>001</value>

<value>099</value>

</condition>

<pkfield name="SEQUENCE"/>

</doctable>

</docspec>

<table name="FK_TABLE">

<pkfield name="SEQUENCE"

fktablename="USER.1.CUSTOMER" fkfieldname="SEQUENCE"/>

<fieldtoread name="FK_COLUMN1"/>

<fieldtoread name="FK_COLUMN2"/>

</table>

</configuration>

</jdbc_tableconfiguration>

If the tablename is missing, the contents of the name attribute is used as a table name to access the database. The two attribute values for the name and fktablename attributes are interpreted as pure character strings and therefore not evaluated in terms of separators and masking characters.

For example, if the table is specified only with the name attribute like this:

<doctable name="USER\.CUSTOMER">.

this means that

<doctable name="USER\.CUSTOMER" tablename="USER\.CUSTOMER">.

The extractor would thus extract the table USER.CUSTOMER from the database.

If special characters occur in the table name we recommend to specify the table name always with the tablename attribute.