apex_add_item_validation
Add server-side validation to Oracle APEX page items. Enforce required fields, regex patterns, length limits, or custom PL/SQL rules with clear error messages.
Instructions
Add server-side validation to a page item (NOT_NULL, REGEX, SQL, PL/SQL).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes | Page ID containing the item. | |
| sequence | No | Validation execution order. | |
| item_name | Yes | The item to validate (e.g., "P10_NAME"). Auto-prefixed if needed. | |
| error_message | No | Message shown when validation fails. Auto-generated if omitted. | |
| condition_item | No | Only validate if this item is not null (optional). | |
| validation_name | Yes | Name for this validation (e.g., "Name Required"). | |
| validation_type | No | Type of validation: - "not_null": Item must not be empty (default) - "max_length": Item must not exceed N chars (set N in validation_expression) - "min_length": Item must have at least N chars - "regex": Item must match regex pattern (set pattern in validation_expression) - "plsql_expression": PL/SQL expression that returns TRUE/FALSE - "plsql_function": PL/SQL function body that returns NULL (valid) or error message - "item_not_null_or_zero": Item must not be null or zero (for number fields) | not_null |
| validation_expression | No | Expression for the validation type: - For max_length/min_length: the length as string (e.g., "100") - For regex: the regex pattern (e.g., "^[0-9]+$") - For plsql_expression: PL/SQL boolean expression (e.g., ":P10_AGE > 0 AND :P10_AGE < 120") - For plsql_function: PL/SQL function body returning NULL or error message |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |