There is an application which is inserting 'Y' or 'N' into the database(Oracle 11g). But according to the standards we should have either 'T' or 'F' for all indicator fields. These indicator fields are null acceptable. This can be taken care at PL/SQL or at the service level. But I would like check the possibilities of enabling check constraint to insert 'T' when it is 'Y' and 'F' when it is 'N'
and I tried following which works but it will not transform any data and gives errors when it tries to insert 'Y' which is expected
ALTER TABLE palm.suppliers
ADD CONSTRAINT check_supplier_ind
CHECK (supplier_ind IN ('T', 'F'));
I did some search to look at possibilities but I don't find what I am looking for. And it is mentioned that we cannot have sub query inside the check constraint.
I would like to know whether it is a valid scenario or not. If it is yes please let me know the possible ways.