psGDropTables

Description

     From a list of tables in a segment map, psGDropTables creates a
a SQL script to drop the tables.   The tables will be dropped in the
same order as they appear in the segment map.

 

Syntax

psGDropTables -Tsegment_map_file -Fnew_sql_file
-Nschema_name -Ooptions

 

Arguments

-T

Segment Map File

-F

Output SQL Script [standard output]

-N

Script Name (optional)

-O

Options

 

Options

s

Sybase

o

Oracle

m

Microsoft SQL Server

i

Informix

r

Postgres

y

MySQL

g

ODBC

p

Stop at the first parsing problem

 

Environment Variables Behind the Scenes

PS_SYSMSG_FILE

Name of DBPowerSuite's messages file.

 

Notes

     The purposes of this program is to write a drop script
1.   which is taylored for specific vendor databases
2.   which checks for the table's existence before dropping the table
3.   which drops the tables without violating referential
     integrity constraints.
     These 3 purposes are accomplished one way or another.

Oracle

     My Oracle script looks like it does because none of Oracle's 3
manifestations of SQL is capable of executing an *if* statement with
a DDL command.  Believe it or not, <if X then drop table> is impossible
with Oracle.   I have come to the conclusion that anyone who buys Oracle
does not buy Oracle based on technical merits.

Sybase

    If you are a Sybase user, use psDropTables (not psGDropTables) to
drop tables.  psDropTables automatically searches the system catalog for
referential integrity constraints and automatically writes the script
to drop child tables first.  psDropTables also drops tables for a
specified owner.

Other Databases and You Also Have Sybase

     If you use Sybase anywhere in your shop and you want to write
drop scripts for Oracle, Informix, ODBC or MS SQL Server, you can
first run psGenerateSegmentMap -Or against your Sybase database in
order to get the correct child/parent table order.  If you don't have
Sybase, you'll have to figure out the child/parent table order
manually.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009