Try OpenEdge Now
skip to main content
SQL Development
OpenEdge SQL Data Definition Language : Working with SQL utilities : Using the SQLDUMP utility : Dumping partitioned tables
 
Dumping partitioned tables
The SQLDUMP utility enables you to dump data from partitioned tables to an external file with the command line parameter - p. The SQLDUMP utility dumps each partition into a separate file. Since these files belong to a single table, the SQLDUMP utility places them in the same directory.
The name of the directory is a combination of the name of the owner and the table name in the following format:
owner_name.table_name
The file name is a combination of the name of the owner, the table name, and the partition name in the following format:
owner_name.table_name.partition_name.dsql
The command line parameter - p is an optional parameter and specifies a comma-separated list or expressions of one or more partitions to be dumped. It is mutually exclusive with the -n and -g parameters.
Notes
*Existence of the - p parameter makes the use of -t optional. If the SQLDUMP utility specifies the -t parameter and not -p, then the utility dumps all the partitions of that table to a single file.
*If -p is specified, then the SQLDUMP utility dumps only those partitions that are specified in the -p list. If both -t and -p parameters are used, then each partition that belongs to or qualifies to belong to partition_name1 must have its table name specified in the -t list; otherwise, the SQLDUMP utility returns an error. It ignores the -p parameter for normal tables listed in the -t list.
*The SQLDUMP utility also returns an error if a standalone % operator is specified with partition names or expressions that are not being dumped.
Examples: SQLDUMP for partitioned tables
The following examples illustrate dumping data from the customers table with three partitions, part_1, part_2, and part_3. The user_name and password for connecting to the database are tucker and sulky. The tucker account must have the authority to access the customers table in the salesdb database.
The following example directs the SQLDUMP utility to create a directory named tucker.customers and dump part_1 and part_3 data of the customers table into the files tucker.customers.part_1.dsql and tucker.customers.part_3.dsql. If the files already exist, the SQLDUMP utility overwrites them.
sqldump -u tucker -a sulky -t customers -p part_1,part_3
progress:T:thunder:4077:salesdb
The following example directs the SQLDUMP utility to search the specified directory for a table whose partition matches part_% and dump partitions of the specified table that match part_% into their respective files. If the files already exist, the SQLDUMP utility overwrites them; If no such files exist, the SQLDUMP utility creates them.
sqldump -u tucker -a sulky -t part_%
progress:T:thunder:4077:salesdb