Use the Target Designer to run an existing SQL script to create target tables.
When you use the Target Designer to generate SQL, you can choose to drop the table in the database before you create it. To do this, select the Drop Table option. If the target database already contains tables, make sure it does not contain a table with the same name as the table you plan to create. If the table exists in the database, you lose the existing table and data.
In the workspace, select the T_EMPLOYEES target definition.
Click
Targets
Generate/Execute SQL
.
The
Database Object Generation
dialog box appears.
In the File Name field, enter the following text to generate SQL script called MKTABLES.SQL
C:\
<PowerCenterClientInstallationDir>
\MKTABLES.SQL
If you installed the PowerCenter Client in a different location, enter the appropriate drive letter and directory.
If you are connected to the source database from the previous lesson, click
Disconnect
, and then click
Connect
.
Select the ODBC data source to connect to the target database.
Enter the necessary user name and password, and then click
Connect
.
The following image shows the
Database Object Generation
dialog box with the File Name MKTABLES.SQL:
Select the
Create Table
and
Drop Table
.
Click
Generate and Execute
.
The Designer runs the DDL code in MKTABLES.SQL to create T_EMPLOYEES.
The results appear on the
Generate
tab in the Output window
Optionally, to edit the contents of the SQL file, click the