List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:January 21 2011 5:23pm
Subject:RE: CURRENT insert ID
View as plain text  
I made a typo in my previous message.

>-----Original Message-----
>From: Jerry Schwartz [mailto:jerry@stripped]
>Sent: Friday, January 21, 2011 12:20 PM
>To: 'Jerry Schwartz'; 'Michael Dykman'; 'MySql'
>Subject: RE: CURRENT insert ID
>
>>-----Original Message-----
>>From: Jerry Schwartz [mailto:jerry@stripped]
>>Sent: Friday, January 21, 2011 11:56 AM
>>To: 'Michael Dykman'; 'MySql'
>>Subject: RE: CURRENT insert ID
>>
>>>-----Original Message-----
>>>From: Michael Dykman [mailto:mdykman@stripped]
>>>Sent: Friday, January 21, 2011 11:50 AM
>>>To: MySql
>>>Subject: Re: CURRENT insert ID
>>>
>>>I think an ON INSERT TRIGGER would take care of this; can't think of
>>>any other way.  Using last_insert_id() in the argument list would
>>>likely yield you the previous value (which might not even related to
>>>your table.
>>>
>[JS] Alas, you cannot update a record in a trigger if the record is in the
>same table as the trigger.
>
>
>CREATE TRIGGER xx AFTER UPDATE ON t
>FOR EACH ROW
> UPDATE t SET f1 = 7;
>
>
[JS] That should have read "AFTER INSERT"; but it's still illegal.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site: www.the-infoshop.com







Thread
CURRENT insert IDJerry Schwartz21 Jan
  • Re: CURRENT insert IDjoao21 Jan
    • Re: CURRENT insert IDDarryle Steplight21 Jan
  • Re: CURRENT insert IDjoao21 Jan
    • RE: CURRENT insert IDJerry Schwartz21 Jan
      • Re: CURRENT insert IDDonovan Brooke22 Jan
        • Re: CURRENT insert IDJesper Wisborg Krogh22 Jan
        • RE: CURRENT insert IDJerry Schwartz24 Jan
          • Re: CURRENT insert IDMark Goodge24 Jan
      • Re: CURRENT insert IDJaime Crespo Rinc√≥n24 Jan
  • Re: CURRENT insert IDCarsten Pedersen23 Jan
    • Re: CURRENT insert IDCarsten Pedersen23 Jan
    • RE: CURRENT insert IDJerry Schwartz24 Jan
Re: CURRENT insert IDMichael Dykman21 Jan
  • RE: CURRENT insert IDJerry Schwartz21 Jan
    • RE: CURRENT insert IDJerry Schwartz21 Jan
      • RE: CURRENT insert IDJerry Schwartz21 Jan
      • Re: CURRENT insert IDMichael Dykman21 Jan
        • RE: CURRENT insert IDJerry Schwartz21 Jan