jDbSync jDBSync
Core Tasks

SourceForge.net Logo

Table task

This task is used as nested element of the <export> task to define exactly which table should be exported.

It is possible to set data to export either with tableName attribute (in this case all data of the table will be exported) or with manual SQL which can be added between the enclosing <table> tags.

If several tables are present in SQL only the first one will be used to identify data block in XML.

Java class is org.chur.ant.db.jdbsynch.export.TableTask

Parameters

Attribute nameDescriptionRequiredDefault
tableName Name of table No if user's sql has been written inside task  – 

Parameters specified as nested elements

field

See <field> task description to get details.

Examples

<taskdef name="export" classname="org.chur.ant.db.jdbsynch.export.ExportTask"/>
<export
	driver="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@tiger:1521:tigerdb"
	userid="sys"
	password="change_on_install"
	dest="export1.xml">
		<table tableName="CUSTOMERS"/>
		<table tableName="CITIES"/>
</export>
			

Export all data from two tables: CUSTOMERS and CITIES

<taskdef name="export" classname="org.chur.ant.db.jdbsynch.export.ExportTask"/>
<export
	driver="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@tiger:1521:tigerdb"
	userid="sys"
	password="change_on_install"
	dest="export1.xml">
		<table>SELECT * FROM CITIES WHERE CITY IS NOT NULL</table>
</export>
			

Export data from CITIES table with not empty city names