Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use REGEXP_LIKE

user2233Mar 2 2011 — edited Mar 2 2011
Hi all

I'm developing a form(in 6i) to insert data to my table through the form insert option, i'm having check constraint in my table and using data block, while creating the data block i selected 'Enforce Data Integrity' option

My Table Is

CREATE TABLE contacts
(
l_name VARCHAR2(30),
p_number VARCHAR2(30)
CONSTRAINT p_number_format
CHECK ( REGEXP_LIKE ( p_number, '^\(\d{3}\) \d{3}-\d{4}$' ) )
);

My scenario Is

I don't want to write any validation in the form level bcz I used 'Enforce Data Integrity' option during designing the data block and i'm having the constraint at table level, if i enter the value for p_number in wrong format it won;t inserted due to the CHECK CONSTRAINT(Enforce Data Integrity)


Problem is

I designed the data block, it automatically creates a 'when-validate-record' for the item p_number as
(automatically generated code due to 'Enforce Data Integrity' option)
--
-- Begin default enforce data integrity constraint P_NUMBER_FORMAT section
--
if not( REGEXP_LIKE ( :CONTACTS.P_NUMBER, '^\(\D{3}\) \D{3}-\D{4}$' ) ) then
message( 'WHEN-VALIDATE-ITEM trigger failed on field - ' || :system.trigger_field );
raise form_trigger_failure;
end if;
--
-- End default enforce data integrity constraint P_NUMBER_FORMAT section

--

while complie it throws the error

Error 201
Identifier REGEXP_LIKE must be declared

How to solve this error

Help me
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2011
Added on Mar 2 2011
3 comments
775 views