From: | "Adam H(dot) Pendleton" <apendleton(at)vgsinc(dot)com> |
---|---|
To: | <pgsql-sql(at)hub(dot)org> |
Subject: | Trigger question |
Date: | 1999-05-10 17:38:29 |
Message-ID: | 005201be9b0b$ed17ad50$bdd0be80@belvoir.army.mil |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I have a dilema, and I'm not sure what the best way to go about solving it
is. I have a table called employee_master, and a table called
employee_payroll. The primary key for both tables is the employee name. It
would be easy for me to set up a trigger that checked the master table when
inserting into the payroll table to make sure the employee exists. My
problem is this: The employee names are stored Last, First in both tables.
The data file I am parsing to insert into the payroll table contains just
the last name. Now I can make a trigger that uses a 'like' and checks the
employees division as well to ensure that they are in the employee_master,
but how do I update with just the last name? I don't want to insert, I need
to be able to update the data in the row.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Si hoc legere scis nimium eruditionis habes.
From | Date | Subject | |
---|---|---|---|
Next Message | Michael J Davis | 1999-05-10 18:41:41 | RE: [SQL] Trigger question |
Previous Message | Tom Lane | 1999-05-10 16:58:07 | Re: [SQL] Slow Inserts Leads To Unable To Dump |