On Thu, Jan 05, 2006 at 01:39:02PM -0600, Kurt Welgehausen wrote:
>  create trigger EnumTrg before insert on MainTbl for each row
>  when (select count(*) from EnumVals where val = new.EnumCol) = 0 begin
>    select raise(rollback, 'foreign-key violation: MainTbl.EnumCol');
>  end;

Wouldn't that be a lot more efficient with some kind of EXISTS test
rather than a count(*)?
-- 
Jim C. Nasby, Sr. Engineering Consultant      [EMAIL PROTECTED]
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

Reply via email to