comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » DataMiner - Number of rows in a table?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: DataMiner - Number of rows in a table? [message #15845 is a reply to message #15782] Tue, 15 June 1999 00:00 Go to previous message
Andrew Kraus is currently offline  Andrew Kraus
Messages: 7
Registered: May 1999
Junior Member
I have had a similar need and the way I decided to go was to add an COUNT
field to the table.
That way I could go to the last record and pull the value from the COUNT
field. However, I can think of several
applications where this approach is limiting, so it may not be right for
you.

Calvin King <cking@sandia.gov> wrote in article
<3765330E.58DB5435@sandia.gov>...
> Fellow IDL Users:
>
> I checked in the 'IDL DataMiner Guide' to see if there is a simple way
> to determine the number of rows in a table and I couldn't find any.
> Hence, I am using the 'IDLdbRecordset::MoveCursor' function to count the
> number of rows as follows:
> status = objRS->MoveCursor(/First)
> count = 1
> status = objRS->MoveCursor(/Next)
> WHILE (status EQ 1) DO BEGIN
> count = count + 1
> status = objRS->MoveCursor(/Next)
> ENDWHILE
> I am using the value of 'count' from above to initialize an array, and
> then reading into this array values from a table as follows:
> status = objRS->MoveCursor(/First)
> x = FLTARR(count)
> y = FLTARR(count)
> FOR I = 0, count-1 DO BEGIN
> x[i] = objRS->GetField(0)
> y[i] = objRS->GetField(1)
> status = objRS->MoveCursor(/Next)
> ENDFOR
>
> Is there a better way (takes less time) to carry out the above task?
> BTW, for my application the value of count is often > 10K.
>
> Thanks for any ideas or suggestions!
>
> Calvin
> Email: cking@sandia.gov
>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Automatic structure definition..
Next Topic: Re: Importing nested structures?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 20:59:23 PDT 2025

Total time taken to generate the page: 1.19969 seconds