If you want to extract metadata from a database (when you select the
option), you must have some database connection defined prior to extracting metadata.In addition to this, if you want to extract internal metadata from a database, you can also right-click any connection item in the Outline pane and select → .
Figure 32.24. Extracting Internal Metadata from a Database
After each of these three options, a Database Connection properties dialog opens.
Figure 32.25. Database Connection Properties Dialog
In order to extract metadata, you must first select database connection from the existing ones (using the Connection menu) or load a database connection using the button or create a new connection as shown in corresponding section. Once it has been defined, Name, User, Password, URL and/or JNDI fields become filled in the Database Connection wizard.
Then you must click
. After that, you can see a database schema.Figure 32.26. Selecting Columns for Metadata
Now you have two possibilities:
Either you write a query directly, or you generate the query by selecting individual columns of database tables.
If you want to generate the query, hold Ctrl on the keyboard, highlight individual columns from individual tables by clicking the mouse button and click the button. The query will be generated automatically.
See following window:
Figure 32.27. Generating a Query
If you check the Prefix table names with
schema checkbox, it will have the following form:
schema.table.column
.
If you check the
Quote identifiers checkbox, it will look like
one of this: "schema"."table"."column"
(Prefix table names with schema is checked) or
"table"."column"
only (the mentioned checkbox is not checked).
This query is also generated using the default (Generic) JDBC specific.
Only it does not include quotes.
Remember that Sybase has another type of query which is prefixed by schema. It looks like this:
"schema"."dbowner"."table"."column"
Important | |
---|---|
Remember that quoted identifiers may differ for different databases. They are:
|
Once you have written or generated the query, you can check its validity by clicking the
button.
Then you must click Metadata opens.
In it, you must finish the extraction of metadata.
If you wish to store the original database field length constraints
(especially for strings
/varchars
), choose the
fixed length or mixed record type.
Such metadata provide the exact database field definition when used
for creating (generating) table in a database, see
Create Database Table from Metadata
By clicking the Outline pane.
button (in case of internal metadata), you will get internal metadata in theOn the other hand, if you wanted to extract external
(shared) metadata, you must click the
meta
subfolder, specifying
the name of the metadata file and clicking
, it is saved into the selected
location.