SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)

SQL/MX Utilities
HP NonStop SQL/MX Release 3.2 Reference Manual691117-001
5-102
Examples of MODIFY
The following example shows the rename of all locations of a table matching a
pattern. Consider a table T1 with locations $DATA01.ZSDABCDE.SPARTX00 and
$DATA02.ZSDABCDE.SPARTY00.
MODIFY TABLE CAT.SCH.T1
RENAME WHERE LOCATION $*.ZSDABCDE.S* MAP NAMES TO
T???????;
Both locations match the pattern and therefore, are renamed. The resulting
locations contains the letter ‘T’ in the leftmost position, and the letters in the
remaining positions are same as the original location. Therefore, locations will be
renamed $DATA01.ZSDABCDE.TPARTX00 and
$DATA02.ZSDABCDE.TPARTY00.
Renaming a single Guardian location of an index
MODIFY INDEX CAT.SCH.IDX1
RENAME WHERE LOCATION
$DATA01.ZSDABCDE.SPARTN00 TO TPARTN00;
Note that the keyword WHERE is optional.
Renaming a set of specified locations of an index
MODIFY INDEX CAT.SCH.IDX2
RENAME LOCATION
( $DATA01.ZSDABCDE.ABCDEF00 TO FEDCBA00
, $DATA02.ZSDABCDE.GHIJKL00 TO LKJIHG00 );
Renaming all locations matching a pattern of a filename of an index
MODIFY INDEX CAT.SCH.MYIX
RENAME WHERE LOCATION $DATA*.ZSDXYZZY.S* TO T?????00;
In the example, the mapping specification T?????00 indicates that the initial
character of the target file name must be 'T', regardless of the character in the
source file name. The subsequent five characters will be copied from the
corresponding positions in the source file name and the last two will be 00.