473,748 Members | 2,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Order of Update Query?

Hello All,

Is the only solution to an update query which requires the records in a
certain order to dump the records into a temp table in the required
order, then do the update query?

I've tried nesting a select query with the proper sort order inside the
update query, but the update query still appears to complete in the
order of the records in the table. I thought that I'd keep it a simple
question without getting into the detail of the 2 solutions that I
already have working on the 360k record table. The issue I'm
specifically dealing with is bloat of the MDB file. The 2 solutions are
as follows:

1 Opening a recordset and moving through it 1 record at a time which
causes severe bloat.

2 Append the data to a temp table in the order required, then do the
update query and move it back to the original table. This requires
deletion of the data twice which causes some bloat, but not as
significant as the first.

I maybe missing something here, so your ideals would be appreciated.
TIA!

--
Regards,

Greg Strong
Nov 13 '05 #1
3 5135
Hello Greg,

I'm not sure why solution 1 would result in any significant bloat. Are
you closing your recordset at the end of your process?

If you have a split front end (application) and back end (database) and
you can easily gain exclusive access to the back end during your
processing, simply compact the back end database programatically when
you're done (look at help for DAO CompactDatabase method ).

If you do end up having to use a temporary table, consider creating a
new temporary database in a separate file with your temp table in it
when you have to do this update process. This can be done either
through code or by having a 'template' database with an empty temp
table in it which you can create copies of. Link to the temp table in
your temp database from the database where your processing is going on.
When you are finished with the temp table simply unlink it and then
delete the entire temp database file.

HTH,
Bruce

Nov 13 '05 #2
Hello Greg,

I'm not sure why solution 1 would result in any significant bloat. Are
you closing your recordset at the end of your process?

If you have a split front end (application) and back end (database) and
you can easily gain exclusive access to the back end during your
processing, simply compact the back end database programatically when
you're done (look at help for DAO CompactDatabase method ).

If you do end up having to use a temporary table, consider creating a
new temporary database in a separate file with your temp table in it
when you have to do this update process. This can be done either
through code or by having a 'template' database with an empty temp
table in it which you can create copies of. Link to the temp table in
your temp database from the database where your processing is going on.
When you are finished with the temp table simply unlink it and then
delete the entire temp database file.

HTH,
Bruce

Nov 13 '05 #3
On 14 Oct 2005 14:34:11 -0700, br***@aristotle .net wrote:
I'm not sure why solution 1 would result in any significant bloat.
Maybe it has something to do with the fact that the DB actually is
creating data with the random number generator. I'm starting with a
little and ending up with a lot. Given this and the fact that Access has
to have some way to 'go back' before committing a transaction may be
what is causing the bloat. I'm just thinking out loud here.
Are you closing your recordset at the end of your process?
Yes.
If you have a split front end (application) and back end (database) and
you can easily gain exclusive access to the back end during your
processing, simply compact the back end database programatically when
you're done (look at help for DAO CompactDatabase method ).
I've compacted the DB via code.
If you do end up having to use a temporary table, consider creating a
new temporary database in a separate file with your temp table in it
when you have to do this update process. This can be done either
through code or by having a 'template' database with an empty temp
table in it which you can create copies of. Link to the temp table in
your temp database from the database where your processing is going on.
When you are finished with the temp table simply unlink it and then
delete the entire temp database file.


Thanks for the ideal.

--
Regards,

Greg Strong
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3531
by: Yannick Turgeon | last post by:
Hello, I'm using SS2000 on NT4. If I run the following query, is it garanteed that the field "OldField1Value" will hold the value Field1 had before the query was run? UPDATE MyTable SET Field1 = 42, OldField1Value = Field1
4
3995
by: Sri | last post by:
I am writing a download process in which i have a condition where i need to join four tables. Each table have lot of data say around 300000 recs. my question is when i am doing the joins on the columns is there any specific order i need to follow.
8
8070
by: Bill | last post by:
I'm trying to create a wizardlike interface using a couple listboxes. I know you've seen it before. You double click on an item in one listbox and it "moves" it to the other. I used to approach it with a table and within the table a yes/no field would determine which box it would be in. An Update statement would be fired changing it from yes to no or vice versa and then refreshing the listboxes. This doesn't seem to scale very well as...
0
1314
by: Gregg | last post by:
I am trying to pass the maximum order number from a table of orders into one record only in another table. I created an update query and created the following: Field: next_fpo_no Table: OrdersTable Update To: Max() It tells me, "You tried to execute a query that does not include the specified experssion 'next_fpo_no" as part of
3
1253
by: Paramveer.Singh | last post by:
Hi all! consider the following table table a (id int primary key) and a particular instance of it: id ------------------------ 5 6
104
10885
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through sorted by Numb. Everything I've read on the web suggests that including the TOP directive should enable ORDERY BY in views. Does someone have an idea why the sorting is not working correctly for this particular view? thanks. CREATE VIEW...
29
27604
by: pb648174 | last post by:
I have the following basic statements being executed: Create a temp table, #TempPaging Insert Into #TempPaging (Col1, Col2) Select Col1, Col2 From SomeOtherTable Order By Col2, Col1 Select * from #TempPaging I can't provide a reproduceable scenario right now without making this
3
2705
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Here is my loop and it runs fine: ---------------------------------------------------- sSQL = "SELECT * FROM STORE_ITEMS" Set DataRec = DB.execute(sSQL) if not DataRec.EOF then do while not DataRec.EOF SKU = trim (DataRec("SKU")) ITEM_ID = trim(DataRec("ITEM_ID")) ...
3
26714
bilibytes
by: bilibytes | last post by:
Hello, I am trying to make a query with some sub queries, and i am having some syntax errors. I have a table with the active users: which contains: id(auto_increment) | user_name | now_active the now_active field is inserted with value = '1', when the user logs in. And is updated to '0' when the user logs out. Here is the code: - At login: it inserts
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.