Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 100727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:38:05+00:00 2026-05-11T00:38:05+00:00

I have read through the solutions to similar problems, but they all seem to

  • 0

I have read through the solutions to similar problems, but they all seem to involve scripts and extra tools. I’m hoping my problem simple enough to avoid that.

So the user uploads a csv of next week’s data. It gets inserted into the DB, no problem.

BUT

an hour later he gets feedback from everyone, and must make updates accordingly. He updates the csv and goes to upload it to the DB.

Right now, the system I’m using checks to see if the data for that week is already there, and if it is, pulls all of that data from the DB, a script finds the differences and sends them out, and after all of this, the data the old data is deleted and replaced with the new data.

Obviously, it is a lot easier to just wipe it clean and reenter the data, but not the best method, especially if there are lots of changes or tons of data. But I have to know WHAT changes have been made to send out alerts. But I don’t want a transaction log, as the alerts only need to be sent out the one time and after that, the old data is useless.

So!

Is there a smart way to compare the new data to the already existing data, get only the rows that are changed/deleted/added, and make those changes? Right now it seems like I could do an update, but then I won’t get any response on what has changed…

Thanks!

Quick Edit:

No foreign keys are currently in use. This will soon change, but it shouldn’t make a difference, because the foreign keys will only point to who the data effects and thus won’t need to be changed. As far as primary keys go, that does present a bit of a dilemma:

The data in question is everyone’s work schedule. So it would be nice (for specific applications of this schedule beyond simple output) for each shift to have a key. But the problem is, let’s say that user1 was late on Monday. The tardiness is recorded in a separate table and is tied to the shift using the shift key. But if on Tuesday there is some need to make some changes to the week already in progress, my fear is that it will become too difficult to insure that all entries in the DB that have already happened (and thus may have associations that shouldn’t be broken) will get re-keyed in the process. Unfortunately, it is not as simple as only updating all events occurring AFTER the current time, as this would add work (and thus make it less marketable) to the people who do the uploading. Basically, they make the schedule on one program, export it to a CSV, and then upload it on a web page for all of the webapps that need that data. So it is simply much easier for them (and less stressful for everyone involved) to do the same routine every time of exporting the entire week and uploading it.

So my biggest concern is to make the upload script as smart as possible on both ends. It doesn’t get bloated trying to find the changes, it can find the changes no matter the input AND none of the data that is unchanged risks getting re-keyed.

Here’s a related question:

Suppose Joe User was schedule to wash dishes from 7:00 PM to 8:00 PM, but the new data has him working 6:45 PM to 8:30 PM.  Has the shift been changed? Or has the old one been deleted and a new one added? 

And another one:

Say Jane was schedule to work 1:00 PM to 3:00 PM, but now everyone has a mandatory staff meeting at 2:00 to 3:00. Has she lost one shift and gained two? Or has one shift changed and she gained one? 

I’m really interested in knowing how this kind of data is typically handled/approached, more than specific answers to the above.

Again, thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:38:06+00:00Added an answer on May 11, 2026 at 12:38 am

    Right now, the system I’m using checks to see if the data for that week is already there, and if it is, pulls all of that data from the DB, a script finds the differences and sends them out, and after all of this, the data the old data is deleted and replaced with the new data.

    So your script knows the differences, right? And you don’t want to use some extra extra tools, apart from your script and MySQL, right?

    I’m quite convinced that MySQL doesn’t offer any ‘diff’ tool by itself, so the best you can achieve is making new CSV file for updates only. I mean – it should contain only changed rows. Updating would be quicker, and all changed data would be easily available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The developer probably used a tool such as class-dump in… May 11, 2026 at 3:40 pm
  • added an answer Updating intellisense on larger projects just kills productivity - Visual… May 11, 2026 at 3:39 pm
  • added an answer Are you sure you can't do this with a relational… May 11, 2026 at 3:39 pm

Related Questions

I'm using .Net 2.0 and this is driving me crazy but there's probably some
Everything works fine when the unit tests class is part of the main project
Many USB devices contain a unique serial number (which is actually a Unicode string)
fopen is failing when I try to read in a very moderately sized file

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.