All, I creating a new database and would like to use triggers on a couple of the tables. Below are two of the tables I will be working with in the triggers;
CREATE TABLE accounts (mrn char(8), acct char(12), discharge_dt int, Primary Key(acct), Foreign Key(mrn) references Patient_Info(mrn)); CREATE TABLE patient_info (name varchar(250), dob varchra(10), mrn char(8) primary key not null); I would like to create a trigger on the patient_info table that is a BEFORE TRIGGER that would verify that the MRN field is 8 characters AND starts with 'MR'. Can you assist me in creating this first trigger? Thanks all! Jerry ________________________________ Disclaimer**** This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of St. Claire Regional Medical Center. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of the email is strictly prohibited. If you received this email in error please notify the St. Claire Regional Helpdesk by telephone at 606-783-6565. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users