LARRY: 

The assumptions are correct. Your example below to also correct.


Assuming that each measurement (10, 20, etc) is in a separate row in a
table, and assuming that each drill hole has an ID value that is consistent
across all depth measurements for that hole then yes, this is a classic
instance in which you'd use a cursor.  EG:

HoldID     Depth     Measurement      FilterValue
101        10        154
101        20        96
101        30        100

There are two different ways you could write the cursor -- either storing
three consecutive measurements as you traverse the table in code and then
UPDATEing the record one place "behind" the last measurement you're looking
at, or else using a SELECT INTO on each record to get the measurements
before and after the current record and UPDATEing the current record in the
cursor.

The number of measurements is variable. That is the hole depth varies.

If the number of measurements and the depth at which they were taken is
consistent for all holes, you could also create a denormalized view of the
data which would allow you to do the filtering with a series of update
commands:

HoldID    Depth10Measure   Depth20Measure   Depth30Measure
101       154              96               100

This is done by creating a view with a lot of IFEQ() functions and a GROUP
BY clause.  It can be very advantageous for reporting purposes, but reliese
on the regularity of the data.



See my second post on this subject. But it seems that you understand my
problem. I would appreciate any hints of how to get started. Eventually
there would be some look up values for other corrections but these would
onlywork on a row by row basis.


Finally, it's possible in standard SQL to write a SELECT statement that can
get the values before and after the row you're operating on, but it's a bit
tricky and I'm not sure that R:Base supports the full syntax.  If you post
the actual structure of your table I'll see if I can come up with something.
That would let you update your filter values with one and only one SQL
statement.
--
Larry

 

Thanks Joe DB

Drake-Brockman Geoinfo Pty Ltd

25 Deague Court

North Perth 6006

Tel / Fax 08 9328 4891

Mob 0427 525952

Email  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]

 

Reply via email to