List:General Discussion« Previous MessageNext Message »
From:Jim Lyons Date:December 5 2008 5:37pm
Subject:Re: Trying to Create a Trigger
View as plain text  
can you not use referential integrity for this - assuming the tables are or
can be made to be innodb?

Does the jobposts table have a jobpost_id field, or is it just "id"?  Maybe
it's a typo?

On Fri, Dec 5, 2008 at 11:28 AM, Lola J. Lee Beno <lola@stripped> wrote:

> David Giragosian wrote:
>
>>
>>  I'm no expert, but 'old' is a table, I'm guessing, and it isn't
>> referenced in the 'from' clause of the query.
>>  could it be that simple...?  David
>>
>>
>
> No . . . 'old' is a virtual table that is the same as the table I'm doing
> work on.  See <http://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html>.
>  What I need to do is check if jobposts record has jobposts.adsource_id
> (foreign key) which still exists in adsource table (primary key).  If
> adsource record still exists, then do not proceed with deleting jobpost
> record - that's what I'm trying to do and thus is what this trigger is
> supposed to do.
>
>
>
> --
> Lola J. Lee Beno - ColdFusion Programmer/Web Designer for Hire
> http://www.lolajl.net/resume | Blog at http://www.lolajl.net/blog/
> "In rivers, the water that you touch is the last of what has passed
> and the first of that which comes; so with present time." - Leonardo da
> Vinci (1452-1519)
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>


-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com

Thread
Trying to Create a TriggerLola J. Lee Beno5 Dec
  • Re: Trying to Create a TriggerDavid Giragosian5 Dec
    • Re: Trying to Create a TriggerLola J. Lee Beno5 Dec
      • Re: Trying to Create a TriggerJim Lyons5 Dec
        • Re: Trying to Create a TriggerLola J. Lee Beno5 Dec
  • Re: Trying to Create a TriggerMartijn Tonies5 Dec
    • Re: Trying to Create a TriggerLola J. Lee Beno5 Dec
  • Re: Trying to Create a TriggerMartijn Tonies5 Dec
    • Re: Trying to Create a TriggerLola J. Lee Beno5 Dec
      • Re: Trying to Create a TriggerAndy Shellam5 Dec
        • Re: Trying to Create a TriggerLola J. Lee Beno5 Dec
          • Re: Trying to Create a TriggerPeter Brawley5 Dec
  • Re: Trying to Create a TriggerMartijn Tonies5 Dec
    • Re: Trying to Create a TriggerWm Mussatto5 Dec
      • Re: Trying to Create a TriggerAndy Shellam6 Dec
  • Re: Trying to Create a TriggerMartijn Tonies6 Dec