26.13 COLUMN_EXISTS Function

This function checks whether a column already exists in the columns array.

Syntax

APEX_EXEC.COLUMN_EXISTS (
    p_columns            IN t_columns,
    p_column_name        IN VARCHAR2,
    p_parent_column_path IN VARCHAR2 DEFAULT NULL )
    RETURN BOOLEAN;

Parameters

Parameter Description
p_columns Columns array.
p_column_name Column name.
p_parent_column_path Path to the parent column to look the index up within.

Returns

TRUE if the column exists, FALSE otherwise.

Example

The following example builds a column array and verifies that the SAL column exists in the array.

DECLARE
    l_columns     apex_exec.t_columns;
BEGIN
    apex_exec.add_column(
        p_columns     => l_columns,
        p_column_name => 'ENAME' );
    apex_exec.add_column(
        p_columns     => l_columns,
        p_column_name => 'SAL' );
    IF apex_exec.column_exists(
           p_columns     => l_columns,
           p_column_name => 'SAL' )
    THEN
        -- the column exists ...
    END IF;
END;