The following examples demonstrate how the various dblook utility
options can be specified from a command line. These examples use the sample database.
quotations marks shown in these examples are part of the command argument
and must be passed to dblook. The way in which quotation
marks are passed depends on the operating system and command line that you
are using. With some systems it might be necessary to escape the quotation
marks by using a forward slash before the quotation mark, for example: "\"My
Status messages are written to the output (either
a -o filename, if specified, or the console) as SQL script comments. These
status messages serve as headers to show which types of database objects are
being, or have been, processed by the dblook utility.
Writing the DDL to the console
You can write the
DDL to the console for everything that is in the sample database.
In this example, the database is in the current directory. For example:
Specifying a schema and a table within the database in the
You can specify that only the objects in the sample database
that are associated with the SAMP and the My Table table
are written to the console. For example:
java org.apache.derby.tools.dblook -d jdbc:derby:sample -z samp -t "My Table"
Specifying multiple tables in the dblook command
can specify more than one table in the dblook command by separating the names
of the tables with a space. For example, for objects in the sample database
that are associated with either the My Table table or the STAFF table,
use the following command:
java org.apache.derby.tools.dblook -d jdbc:derby:sample -t "My Table" staff
Writing DDL to a file without a statement delimiter
write the DDL for all of the objects insample database to
the myDB_DDL.sql file without a statement delimiter, you
must omit the default semi-colon. You can append the DDL to the output files
if the files are already there. For example: