473,378 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Suggestions Plz

I have two tables A & B.I Have 20 records that has to be inserted into table A and at the same Table B should also be updated.This procedure should happen on daily process and on each day the previous days data which is inserted should be deleted so that the present Data is added..
Feb 14 '08 #1
2 918
jamesd0142
469 256MB
I have two tables A & B.I Have 20 records that has to be inserted into table A and at the same Table B should also be updated.This procedure should happen on daily process and on each day the previous days data which is inserted should be deleted so that the present Data is added..
So B is a mirror of A ?

In that case...
create a query to find all the data in table A that is not in table B into a temp table.

them delete whats there in B already and add the data from the temp table to B
---------------
If you want to only store thae new data in a table consider running this command before you populate the table(s)

Expand|Select|Wrap|Line Numbers
  1. delete A
  2.  
Feb 14 '08 #2
ck9663
2,878 Expert 2GB
I have two tables A & B.I Have 20 records that has to be inserted into table A and at the same Table B should also be updated.This procedure should happen on daily process and on each day the previous days data which is inserted should be deleted so that the present Data is added..
if A = B, then why do you need 2 tables? If A is transactional and B is historical, add a field (ie TRAN_DATE) on B to identify when the reocord was inserted in B. Use table name convention in A (tram_yyyymmdd). Create a scheduled batch to create this table on a daily basis.

I am not a fan of deleting tables and even records. Specially transactional. If you loose them, you loose them. Storage is much cheaper now that you can store those tables until you are 100% sure you don't need them. This cost always outweighs the gain.

-- CK
Feb 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matt W | last post by:
Hi all, I'm planning to use MySQL's full-text search for my forum system (possibly 5+ million posts). I've been playing with it a lot lately to see the performance and functionality and have...
10
by: Ron Ruble | last post by:
I'd like to get suggestions from some of the folks here regarding tools and processes for a new, small development team. I'm starting a new job next week, and part of the fun is being able to...
1
by: Brian Basquille | last post by:
Hello all. Have been working on the Air Hockey game on and off for a couple of weeks now.. but have had plenty of other assignments to keep me busy along with it. But i would like some...
62
by: A.M. Kuchling | last post by:
Here are some thoughts on reorganizing Python's documentation, with one big suggestion. The tutorial seems to be in pretty good shape because Raymond Hettinger has been keeping it up to date. ...
6
by: iclinux | last post by:
I have to build a GUI applicaiton that could run on different OS such as windows and *nix, which GUI toolkit is better? Best Regards.
45
by: Gregory Petrosyan | last post by:
1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: >>> raise NameError Traceback (most recent...
26
by: Frank Samuelson | last post by:
I love Python, and it is one of my 2 favorite languages. I would suggest that Python steal some aspects of the S language. ------------------------------------------------------- 1. Currently...
0
rnd me
by: rnd me | last post by:
Purpose: Allows you to create "presets" for text form inputs. "Lightweight and simple to setup, it adds a lot of convenience for ~1kb of code." Only one function, two parameters: First...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.