SWAP_PARTITIONS_BETWEEN_TABLES

Swaps partitions between two tables.

Syntax

SWAP_PARTITIONS_BETWEEN_TABLES (
    '[schema.]staging‑table',
    'min‑range‑value',
    'max‑range‑value', 
    '[schema.]target‑table'
)

Parameters

schema

Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example:

myschema.thisDbObject
staging‑table

The staging table from which to swap partitions.

min‑range‑value

The minimum value of the partition to swap.

max‑range‑value

The maximum value of the partition to swap.

target‑table

The table to which the partitions are to be swapped. The target table cannot be the same as the staging table.

Privileges

One of the following:

Table Attribute Requirements

The following attributes of both tables must be identical:

Table Restrictions

The following restrictions apply to the source and target tables:

Examples

See Swapping Partitions.