![]() |
jDBSync | ||||||||||||||||||||||||||||||||||||||||||
|
ExportStruct taskExport table or view structure in a file as SQL Java class is org.chur.ant.db.dbstructure.ExportStructTask Parameters
Parameters specified as nested elementstableUse nested <table> elements to specify which tables structure should be discovered. To get more details about this task see this page. viewUse nested <view> elements to extract SQL definition of a view. This is database specific task and currently only DB2 and Oracle are supported. To get more details about this task see this page. At least one <table> or <view> element should be specified. Examples<taskdef name="ExportStruct" classname="org.chur.ant.db.dbstructure.ExportStructTask"/> <ExportStruct driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@tiger:1521:tigerdb" userid="system" password="manager" dest="export1.sql"> <table taskName="DUAL"/> </ExportStruct> This task discovers the structure of DUAL table and saves SQL to re-create the table in export1.sql file: -- Primary key: CREATE TABLE DUAL ( DUMMY VARCHAR2(1)); <taskdef name="ExportStruct" classname="org.chur.ant.db.dbstructure.ExportStructTask"/> <ExportStruct driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@tiger:1521:tigerdb" userid="system" password="manager" schema="SYS" dest="export2.sql"> <view taskName="ALL_ALL_TABLES"/> </ExportStruct> This task discovers the SQL which has been used to create ALL_ALL_TABLES view and saves this SQL in export2.sql file: select OWNER, TABLE_NAME, TABLESPACE_NAME, CLUSTER_NAME, IOT_NAME, STATUS, PCT_FREE, PCT_USED, ..... CLUSTER_OWNER, DEPENDENCIES, COMPRESSION, DROPPED from all_tables union all select OWNER, TABLE_NAME, TABLESPACE_NAME, CLUSTER_NAME, IOT_NAME, STATUS, PCT_FREE, PCT_USED, .... CLUSTER_OWNER, DEPENDENCIES, COMPRESSION, DROPPED from all_object_tables |