cursor or array equivalent?

cubdh23

Registered User.
Local time
Today, 11:48
Joined
Jul 13, 2009
Messages
11
Is there a cursor equivalent function for SQL queries?
I want to be able to test each number in a column against something and perform actions on that number depending on the outcome of that test.

But for this to happen, i need to one by one test each number in the column by scrolling down record by record.

How can i go about this in access sql??
 
Two things.

1) Jet does not support cursors. However, you could replicate the actions of a cursor by using a recordset in VBA and looping over the recordset.

2) Cursors, IMO, are overrated. There are cases where cursors are used when there exists a perfectly valid set-based operation that would not only be more clearer but also quicker & efficient.

What exactly are you wanting to accomplish with this?
 
What we are doing is we are using "Numbers Stickers" to identify certain assets, thousands of them. When a repair is done on the asset, this is logged and stored into the database. Now sometimes the asset cannot be repaired so it is replaced and a new "number" is placed at the same location along with a new asset.

Now I am trying to write a query to show how long our assets are lasting out there relative to each other. We can see which manufactuers are uneconomical, which parts are failing, what problems we are facing ect ect ect.

In order for me to accomplish what i am trying to do, i would like to compare each number to some other numbers, group those numbers together put it somewhere. Go to the 2nd number compare to others group them store them, over and over till the end. Then use all those groups to do another query. Access front with sql server back.
 

Users who are viewing this thread

Back
Top Bottom