Thread

  1. Re: [SQL] Constraint Problem

    Gerhard Dieringer <dieringg@eba-haus.de> — 1999-09-30T10:46:26Z

    Chairudin Sentosa wrote:
    
    > ...
    >  constraint ck_ngetest_disc_pin check
    >     (disc_pin = 'Y' or
    >      disc_pin = 'N')
    > ...
    > ...
    > insert into ngetest
    >(custnum, first_name, service_type, sex, detailed_bill, ngetest_status,disc_all)
    >values (1,'Bob','Y','M','Y','A','Y');
    >ERROR:  ExecAppend: rejected due to CHECK constraint ck_ngetest_disc_pin
    >...
    
    I am not sure, but I think the problem is, that you have no value for disc_pin in your insert, so it is NULL
    but in your constraint ck_ngetest_disc_pin you only allow 'Y' or 'N' for this attribute.
    
    The same problem ocures for the other inserts.
    
    I hope this will help you.
    
    Gerhard