Results 1 to 2 of 2

Thread: update trigger

  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Unanswered: update trigger

    I have the following table

    Businesses
    (
    id (primary key)
    label
    street name
    street number
    phone1
    phone2
    phone3
    hours
    )

    I am trying to write a trigger for this table that will do the following:

    If there is no change in the street name or street number simply
    insert ino the business_history table the id and the label
    If there is a change to the street name or street number then instert into the the business history tabe the id, label, new street name and street num, and old street name and street num.

    Any suggestoins

    Business_History
    {
    business_id
    business_label
    new street name
    new street num
    old street name
    old street num
    }

  2. #2
    Join Date
    Sep 2003
    Location
    London
    Posts
    56
    MySQL doesn't support triggers I'm afriad. There is planned support in MySQL 5, but as 4.1 is still alpha, I wouldn't like to guess when this may be out (and stable).

    Regards,
    Matt.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •