Files
Jailer/docs/filters.html
T
2020-12-01 19:20:25 +01:00

211 lines
9.1 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jailer - Filters</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta name="description" content="Data Export Tool" />
<link rel="shortcut icon" href="favicon.ico" />
<meta name="keywords" content="data export referential integrity java jdbc dbms" />
<link rel="stylesheet" type="text/css" href="exporting-data-Dateien/styles.css" />
</head>
<body left-margin="0" top-margin="0">
<div align="left">
<table style="text-align: left; position: absolute; left: 0pt; top: 0pt;" border="0"
cellpadding="0" cellspacing="0" height="407" width="100%">
<tbody>
<tr>
<td colspan="2" class="bannerbackground" height="33" width="100%">
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tbody>
<tr>
<td><img src="exporting-data-Dateien/logo.png" hspace="10" /></td>
<td class="slogan" width="100%">Database&nbsp;Subsetting&nbsp;Tool</td>
<td style="text-align: right; width: 100%;">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><a href="http://sourceforge.net/projects/jailer/"><img src=
"http://sflogo.sourceforge.net/sflogo.php?group_id=197260&amp;type=1"
alt="SourceForge.net Logo" style=
"border: 0px solid ;" /></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="nav1background" height="33" width="100%">&nbsp;
<b><font color="#FFFFFF"><a href="home.htm" target="_self" class=
"tlink">Home</a> &nbsp;&nbsp;&nbsp; <a href="quicktour.htm" target="_self"
class="tlink">Quick Tour</a> &nbsp;&nbsp;&nbsp;<a href="exporting-data.htm"
target="_self" class="tlinkA">Tutorial</a> &nbsp;&nbsp;&nbsp;<a href=
"data-browsing.html" target="_self" class="tlink">Data Browser</a>
&nbsp;&nbsp;&nbsp;<a href="faq.html" target="_self" class="tlink">FAQ</a>
&nbsp;&nbsp;&nbsp;<a href="api.html" target="_self" class="tlink">API</a>
&nbsp;&nbsp;&nbsp; <a href="design.htm" target="_self" class=
"tlink">Documentation</a> &nbsp;&nbsp;&nbsp; <a href=
"http://sourceforge.net/forum/?group_id=197260" target="_self" class=
"tlink">Forum</a>&nbsp;&nbsp;&nbsp; <a href=
"http://sourceforge.net/project/showfiles.php?group_id=197260" target="_self"
class="tlink">Download</a> &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;</font></b></td>
</tr>
<tr>
<td colspan="2" class="spacer" width="100%"></td>
</tr>
<tr>
<td class="lmenucontainer" height="100%" valign="top" width="14%">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="100%"><br /></td>
</tr>
</tbody>
</table>
</center>
</div>
<ul>
<li>Basic</li>
<ul>
<li><a href="exporting-data.htm" target="_self" class="llink">SQL
Export</a></li>
</ul>
<ul>
<li><a href="exporting-xml.html" target="_self" class="llink">XML
Export</a></li>
</ul>
<ul>
<li><a href="deleting-data.htm" target="_self" class="llink">Deleting
Data</a></li>
</ul>
<br>
<li>Advanced</li>
<ul>
<li><a href="filters.html" target="_self" class=
"llinkA">Filters</a></li>
</ul>
<ul>
<li><a href="subset-by-example.html" target="_self" class=
"llink">Subset&nbsp;By&nbsp;Example</a></li>
</ul>
</ul>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tbody>
<tr>
<td class="content2background"><img style="width: 160px; height: 1px;"
alt="" src="architecture-Dateien/vgradp.gif" /></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
</td>
<td class="contentbackground" height="418" valign="top" width="86%">
<div align="right">
<table border="0" cellpadding="0" cellspacing="0" height="542" width="98%">
<tbody>
<tr>
<td class="content" height="520" valign="top" width="100%">
<small><small>&nbsp;</small></small><br />
<br />
A filter assigns an SQL expression to a table column.
<br /><br />
<h3>Export filter</h3>An export filter is evaluated during the
export phase. The column values will be replaced by the result of
the expression when the export file is written. ${old-value} is a
synonym for the filtered column.<br />
<br />
With the filter EMPLOYEE.NAME := lower(${old-value})<br />
<br />
<img width="472" height="300" src="filterimg/image001.png" /><br />
<br />
The employee names will be exported with all letters
lowercase:<br />
<br />
<img src="filterimg/image002.png" />
<h4>Literal filter</h4>A literal filter is also evaluated during
the export phase. The result will be written literally into the
export file. During the import phase, it will be evaluated as a SQL
expression. To define a literal filter, add the prefix "literal:"
to the filter expression. The filter:<br />
<br />
<img width="564" height="242" src="filterimg/image003.png" /><br />
<br />
replaces employee names with numbers from a sequence in the target
database.<br />
<br />
<img src="filterimg/image004.png" /><br />
<br />
<h3>Import filter</h3>An import filter is evaluated during the
import phase. Import filters are especially useful for filtering
primary key columns. Filters on primary key columns are
automatically applied to the corresponding foreign key columns.
With an import filter, it's guaranteed that a 'null'-value remains
null and that a foreign key value is mapped to the same value as
the primary key even if the filter expression is not a
deterministic function.<br />
<br />
This filter uses a sequence to generate new EMPNOs during the
import phase:<br />
<br />
<img width="1023" height="402" src="filterimg/image005.png" /><br />
<br />
<br />
<h3>Filter templates</h3>Templates allow defining filters based on
a condition on a column.<br />
<br />
<img width="1066" height="550" src="filterimg/image007.png" />
<br />
<br /><br />
<h3 id="nullfilter">"<i>null</i>" filter on foreign key columns</h3>
If a foreign key of a table is nullable, a "<i>null</i>" filter on it (resp. on all columns of a composite foreign key) causes only the foreign key columns of those rows to be filled with "<i>null</i>", whose parent row is not exported as well.<br>
In the same way, only the foreign key columns of those rows are set to "<i>null</i>" when deleting, which are not deleted themselves but their parent.
<br /><br />
The extraction model editor offers the corresponding checkbox "Set foreign key to null ...".
<br /><br/>
<img width="1227" height="359" src="nullfilter.png" />
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td height="12" valign="top" width="14%"><br /></td>
<td><br /></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>