CREATE_OR_REPLACE_DIRECTORY procedure - Create or replace a directory alias

The CREATE_OR_REPLACE_DIRECTORY procedure creates or replaces a directory alias for the specified path.

Directory information is stored in SYSTOOLS.DIRECTORIES, which is created in the SYSTOOLSPACE when you first reference this module for each database.

Syntax

Read syntax diagramSkip visual syntax diagramUTL_DIR.CREATE_OR_REPLACE_DIRECTORY (alias,path)

Procedure parameters

alias
An input argument of type VARCHAR(128) that specifies the directory alias.
path
An input argument of type VARCHAR(1024) that specifies the path.

Authorization

EXECUTE privilege on the UTL_DIR module.

Examples

Example 1: Create a directory alias. Because the directory already exists, an error occurs.

CALL UTL_DIR.CREATE_DIRECTORY('mydir', 'home/user/temp/empdir')@

This example results in the following output:

SQL0438N  Application raised error or warning with diagnostic text: "directory
alias already defined".  SQLSTATE=23505

Example 2: Create or replace a directory alias.

CALL UTL_DIR.CREATE_OR_REPLACE_DIRECTORY('mydir', 'home/user/temp/empdir')@

This example results in the following output:

  Return Status = 0