I have a customer order table that list each item a customer purchases along with their name, order date. These are automatically populated when someone places an order, therefore if John Doe orders 5 items, there are 5 new rows added to the table (one for each item he ordered) and his name next to each one.
I have a separate customer billing table which has order date, customer name, and boolean fields for delivered, billed, paid (we deliver directly to the customer).
I'm trying to setup a trigger that automatically adds a new row for "John Doe" in the Customer Billing table when he places an order, but when I setup the trigger I get 5 new entries of his name (b/c his name was added on each of the items in the order table).
Anyway to do some sort of "distinct" insert with the triggers to solve this problem?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
niteowl2
I have a customer order table that list each item a customer purchases along with their name, order date. These are automatically populated when someone places an order, therefore if John Doe orders 5 items, there are 5 new rows added to the table (one for each item he ordered) and his name next to each one.
I have a separate customer billing table which has order date, customer name, and boolean fields for delivered, billed, paid (we deliver directly to the customer).
I'm trying to setup a trigger that automatically adds a new row for "John Doe" in the Customer Billing table when he places an order, but when I setup the trigger I get 5 new entries of his name (b/c his name was added on each of the items in the order table).
Anyway to do some sort of "distinct" insert with the triggers to solve this problem?
Thank you,
james
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.