DECLARE
v_test_nbr NUMBER;
v_check_exists NUMBER;
BEGIN
BEGIN
v_test_nbr := to_number(:P6_TEXT_FIELD);
EXCEPTION
WHEN OTHERS THEN
-- or catch 1722 (invalid number) and 6502 (char to number conversion error)
v_test_nbr := NULL;
END;
IF v_test_nbr IS NOT NULL
THEN
-- if v_test_nbr is not null then the field should be numerically valid
-- if it isn't then this code would be skipped and this validation
-- will not throw an error.
-- However, the previous validation will still fail when text is entered,
-- so this shouldn't matter.
BEGIN
SELECT 1
INTO v_check_exists
FROM my_table
WHERE column_name = :P6_TEXT_FIELD;
EXCEPTION
WHEN no_data_found THEN
v_check_exists := 0;
END;
IF v_check_exists = 1
THEN
RETURN 'A record with this key already exists';
END IF;
END IF;
RETURN NULL;
END;
No. | Subject | Author | Date | Views |
---|---|---|---|---|
86 | What Is ERP? | admin | 2018.02.14 | 121 |
85 | LIST OF VALUE (DYNAMIC) | admin | 2016.04.28 | 126 |
84 | Global & Custom Serach | admin | 2016.04.28 | 127 |
83 | Column Data 일괄 추가 | admin | 2023.11.24 | 128 |
82 | HEAD TITLE (제목)을 조건에 따라 바꾸기 | admin | 2016.05.03 | 132 |
81 | Oracle APEX 5.1.4 Installation | admin | 2018.04.17 | 132 |
80 | Delimiter | admin | 2016.04.29 | 133 |
79 | APEX Connect 2016 - David Peake - New Features in Oracle Application Express 5.1 | admin | 2017.11.25 | 135 |
78 | How to Update Oracle XE | admin | 2018.04.25 | 138 |
77 | BOOLEAN SAMPLE | admin | 2016.05.11 | 144 |
76 | COUNT | admin | 2016.04.28 | 145 |
75 | Outer Join with Oracle SQL | admin | 2016.04.29 | 147 |
74 | wwv_flow_files | admin | 2016.05.01 | 147 |
73 | Field Showing | admin | 2016.04.01 | 148 |
72 | Using SQL*Plus to Unlock and Change Passwords | admin | 2023.06.04 | 148 |
71 | CREATE (INSERT) PROCESS | admin | 2016.04.28 | 150 |
70 | NVL | admin | 2016.05.19 | 151 |
69 | Forgot Oracle username and password, how to retrieve? | admin | 2022.03.18 | 151 |
68 | PHONE NUMBER | admin | 2016.04.28 | 152 |
67 | MAX | admin | 2016.04.28 | 154 |