If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySql Replace

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-10, 08:23
kippi kippi is offline
Registered User
 
Join Date: Mar 2010
Posts: 1
MySql Replace

Hey

I am exporting some data from a web page, the data is changing and what I would like to do is check if the new data I am adding has changed and if it has copy the old row to another table and add the new data.

Is this somthing that MySql can do? I was thinking of using replace and using a tigger. Any help would be great.

Thanks

Chris.
Reply With Quote
  #2 (permalink)  
Old 03-24-10, 09:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by kippi View Post
Is this somthing that MySql can do?
sure, but not by itself

you need application logic

whether you put that logic into a trigger is up to you
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-24-10, 17:22
thewebhosting thewebhosting is offline
Registered User
 
Join Date: Mar 2010
Posts: 16
Hi,

As r937 updated, you can accomplish your requirement but for that you have to apply the logic with select, match, update and insert queries.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On