Mysql Trigger error

Thread Solved

Join Date: Apr 2008
Posts: 490
Reputation: veledrom is an unknown quantity at this point 
Solved Threads: 0
veledrom veledrom is offline Offline
Posting Pro in Training

Mysql Trigger error

 
0
  #1
Jul 25th, 2008
Hi,

Select closing From balance Where account_no = 12 Limit 1 returns an error "You can't specify target table 'balance' for update in FROM clause"
Where is mistake?
Thanks

  1. AFTER INSERT ON Close
  2. BEGIN
  3. INSERT INTO balance (DATE, opening, account)
  4. VALUES (CURDATE(), (SELECT closing FROM balance WHERE account_no = 12 LIMIT 1), 12);
  5. END
Last edited by veledrom; Jul 25th, 2008 at 6:11 am. Reason: mistake
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 296
Reputation: tesuji is on a distinguished road 
Solved Threads: 42
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: Mysql Trigger error

 
0
  #2
Jul 25th, 2008
Hello

Your mistake! You cannot do that !

-----
tesu
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 490
Reputation: veledrom is an unknown quantity at this point 
Solved Threads: 0
veledrom veledrom is offline Offline
Posting Pro in Training

Re: Mysql Trigger error

 
0
  #3
Jul 26th, 2008
I tried but didn't work. I dont use this logic. Therefore, ignore this post.
Thanks for your reply tejusi/
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC