Library Version 12.1.6.2

BFILE SQL Objects and Functions
Prev | Appendix A. Using the BFILE Extension | Next

## BFILE SQL Objects and Functions

When the BFILE extension is enabled, you can create a `DIRECTORY` object. These objects are required before you can store a pointer to a file in a `BFILE` column.

`DIRECTORY` objects are stored in a special table called `BFILE_DIRECTORY`. This table is automatically created for you when it is needed. You should not manually create this table.

You manage `DIRECTORY` objects using the following SQL functions:

BFILE_CREATE_DIRECTORY
BFILE_REPLACE_DIRECTORY
BFILE_DROP_DIRECTORY

The following sections describe the SQL functions that you can use when the BFILE extension is enabled.

### BFILE_CREATE_DIRECTORY

    BFILE_CREATE_DIRECTORY(directory, path)

Creates a `DIRECTORY` object as a path. The specified path must not already exist, or `Directory already exists` is returned.

### BFILE_REPLACE_DIRECTORY

    BFILE_REPLACE_DIRECTORY(directory, path)

Replaces the named `DIRECTORY` object using the specified path. If the object does not exist, `Directory does not exist` is returned.

### BFILE_DROP_DIRECTORY

    BFILE_DROP_DIRECTORY(directory)

Drops the named `DIRECTORY` object. If the object does not exist, `Directory does not exist` is returned.

### BFILE_NAME

    BFILE_NAME(directory, filename)

Returns the BFILE locator.

### BFILE_FULLPATH

    BFILE_FULLPATH(column)

Returns the full path.

### BFILE_OPEN

    BFILE_OPEN(column)

Extracts the directory and file names from the BFILE locator, and then opens that file. On success, a BFILE handle is returned. Otherwise, `0` is returned.

### BFILE_READ

    BFILE_READ(BFILE handle, amt, offset)

Reads at most `amt` data from the BFILE handle, starting at `offset`. On success, `Data` is returned. Otherwise, `0` is returned to indicate that no more valid data is available.

### BFILE_CLOSE

    BFILE_CLOSE(BFILE handle)

Closes the BFILE handle.

### BFILE_SIZE

    BFILE_SIZE(column)

Returns the size of the BFILE. On success, the size is returned. Otherwise, -1 is returned.

Prev | Up | Next
Appendix A. Using the BFILE Extension | Home | BFILE C/C++ Objects and Functions