background image
<< Generating a Script for Creating Objects | Exporting the Data >>
<< Generating a Script for Creating Objects | Exporting the Data >>

Generating a Script for Creating Views

Exporting the Database Objects
Deploying a Database Application 7-9
2.
In the Export dialog box, specify the name and location of the to be created that
will contain the SQL statements to create the objects and insert data. For example:
C:\my_exports\2day_plsql.sql
3.
Under Options, specify the following options for creating the tables for this
example:
Show Schema
: Uncheck. In this example, if you check this option, it might be
inappropriate because the schema name in your test or production
environment might not be the same as that in your development environment.
Storage
: Uncheck, because this does not apply here.
Terminator
: Check. This is necessary because you want to be able run the
resulting script.
Pretty Print
: Check. If you check this option, the output is more readable.
Include BYTE Keyword
: Uncheck, unless you are working with a multibyte
character set, in which case you should check this option.
Add Force to Views
: Uncheck, because this does not apply here.
Constraints as Alters
: Uncheck, because this does not apply here.
Export Data
: Uncheck, because you will export the data separately for this
example.
Include Drop Statements
: Uncheck. If you want these objects to replace any
existing objects with the same name, you can include this. However, a better
practice is to have a separate drop script that can be run to remove an older
version of your objects before creation. This avoids the chance of accidentally
removing an object you did not intend to drop.
4.
Click the Objects tab.
5.
In the Objects tab:
Select
hr_conn
for the database connection to be used.
For the type of objects to be exported, expand All My Objects. Expand
Functions
, and then select CALCULATE_SCORE. Expand Packages, and then
select EMP_EVAL. Uncheck the other object types.
6.
Click Apply to generate the script.
Generating a Script for Creating a Synonym and a View
Generate a script to create the synonym and the view that you created if you followed
the instructions earlier in this guide.
To generate a script for creating a synonym and a view:
1.
From the SQL Developer main menu, select Tools, then Export DDL (and Data).
2.
In the Export dialog box, specify the name and location of the to be created that
will contain the SQL statements to create the objects and insert data. For example:
C:\my_exports\2day_other.sql
3.
Under Options, specify the following options for creating the tables for this
example:
Show Schema
: Uncheck. In this example, if you check this option, it might be
inappropriate because the schema name in your test or production
environment might not be the same as that in your development environment.