6.4.9RENAME DIRECTORY
Syntax
RENAME DIRECTORY directory_name [, directory_name]* AS new_directory_name [, new_directory_name]*
Description
Rename (or move) an existing directory named directory_name as new_directory_name. Multiple directories can be renamed (or moved) at once by separating their names with a comma (,). If new_directory_name already exists, it is not overwritten, no subsequent directories are renamed (or moved), and an error is raised.
Parameter(s)
directory_name – mandatory string that specifies the name of the directory to rename (or move).
new_directory_name – mandatory string that specifies the new name and/or location in the file system to use for renaming and/or moving directory_name.
Return
Nothing
Example(s)
# rename a directory named "my_directory0" as "my_directory1" (the directory "my_directory1" will not be overwritten if it already exists)
RENAME DIRECTORY my_directory0 AS my_directory1
# rename two directories named "my_directory2" and "my_directory3" as "my_directory4" and "my_directory5", respectively (neither directory will be overwritten if it already exists)
RENAME DIRECTORY my_directory2, my_directory3 AS my_directory4, my_directory5
# move a directory named "my_directory6" into a root directory named "data" and rename it as "my_directory7" (the directory "my_directory7" will not be overwritten if it already exists)
RENAME DIRECTORY my_directory6 AS /data/my_directory7
# move a directory named "my_directory8" into a relative directory named "backup" (the directory "my_directory8" will not be overwritten if it already exists)
RENAME DIRECTORY my_directory8 AS backup/