tables!!!

  • hi, I require to peform update operation on more than one table based on the values being updated in a table.

    tis update is a one off job. below is the tables needed:-

    -customer_info(customer_ID, given_name, address, phone, country_ID)

    -Newsletter_Details(customer_ID, NewsletterSubscribe_ID)

    -ProductOwn_Details(customer_ID, ProductOwn_ID)

    -NewsletterSubsribe(NewsletterSubscribe_ID, Newsletter_Name, Newsletter_Desc)

    -ProductOwn(ProductOwn_ID, ProductName, ProductDesc)

    ProductOwn_Details is a link table between customers and products they have purchased.

    Newsletter_Details is a link table between customers and newsletters they should receive.

    i need to update the table by:-

    *If a customer purchases a particular product (ProductOwn_ID = 1) they should receive a particular newsletter (NewsletterSubscribe_ID = 2).

    *then if i want to minimise the number of customer by smaller the group how to code that onli taiwan customer need to update the productOwned and newsletter??

    *as for the country_ID it is found at the table(customer_info)

    so which table should i update and how???

    pls giv me some advice !!! thanx =)

  • First to save headache you need to have a table or a field that relates Products to Newsletters.

    quote:


    If a customer purchases a particular product (ProductOwn_ID = 1) they should receive a particular newsletter (NewsletterSubscribe_ID = 2).


    Insert into ProductOwn_Details, user trigger FOR INSERT on ProductOwn_Details that takes a look at all inserted table that gets the customer_ID and the NewsletterSubscribe_ID

    base on the product by using ProductOwn_ID against the table i suggested building or field adding. Then do an insert or update to Newsletter_Details.

    quote:


    then if i want to minimise the number of customer by smaller the group how to code that onli taiwan customer need to update the productOwned and newsletter??

    as for the country_ID it is found at the table(customer_info)


    Not sure what you mean here.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • for the qoute:

    then if i want to minimise the number of customer by smaller the group how to code that onli taiwan customer need to update the productOwned and newsletter??

    as for the country_ID it is found at the table(customer_info)

    i want to update those customers who is at Taiwan then if a taiwan customer purchases a particular product (ProductOwn_ID = 1) they would receive a particular newsletter (NewsletterSubscribe_ID = 2).

  • Then for my previous message where I suggested having a newsletter to product mapping table add a country field should allow you to get that as well.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply