Jump to content


Photo
* * * - - 1 votes

how to jump to a particular record and then access data henceforth


6 replies to this topic

#1 Balaram

Balaram

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male
  • Location:INDIA

Posted 08 January 2007 - 07:27 PM

hello !!!
i need to find a way in which i can access a particluar record and then proceed henceforth in native PRO IV . For example i need to go to 100th record of a file and then read henceforth 101 ,102 etc etc :-).i do not want to read the file sequentially , i want to read directly the 100th record and preceeding records .PRO IV IS ISAM , but how do i go abt reading that way .

I have a situation where i need incremental data , i have figured out a solution for that but the problem is the file is being read sequentially , for every run all the records are read , what i want is to read the records which have not been read so that the performance of the query is improved ..

P.S : i am working in native PRO IV .

Edited by Balaram, 08 January 2007 - 07:29 PM.


#2 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 08 January 2007 - 10:25 PM

Hi,

What keys do you have for the file?

If its a Sequence number as the last key part, then just set that to '000100' and then set a $VAR to '999999' and do a SEL-RANGE($VAR) in Default Logic.....

Rob D.

#3 Tyleulen

Tyleulen

    Advanced

  • Members
  • PipPipPip
  • 59 posts
  • Gender:Male

Posted 08 January 2007 - 10:28 PM

Isn't that what SEL-PARTIAL does?

Have a key in your file that is the sequence number and SEL-PARTIAL(#STARTING_RECORD)

#4 Balaram

Balaram

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male
  • Location:INDIA

Posted 09 January 2007 - 06:39 AM

Hi,

What keys do you have for the file?

If its a Sequence number as the last key part, then just set that to '000100' and then set a $VAR to '999999' and do a SEL-RANGE($VAR) in Default Logic.....

Rob D.


i have 8 keys in that file , some of them are (5)date ,(6)terminal, (7)time and (8)seq .I want to select records based on time .Guess SEL-RANGE won't work here ;) ,because i would have records which might be having a different key sets .. apart from the first one .I need to jump to that particlar record and process thereafter ...

#5 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 09 January 2007 - 07:24 AM

You should make 'Terminal' the first key (if possible), then you can set the date, time & seq to the first record you want to read, and then SEL-RANGE to the last record....

Rob.

#6 Rob_Stebbens

Rob_Stebbens

    Member

  • Members
  • PipPip
  • 30 posts
  • Gender:Male

Posted 09 January 2007 - 09:02 AM

You should make 'Terminal' the first key (if possible), then you can set the date, time & seq to the first record you want to read, and then SEL-RANGE to the last record....

Rob.


Rob, I don't see why there needs to be any kind of SEL to do this.

Example, in an update :
Col1 contains the values 1,2,3,4,5,6,7,8,9,10

If in default logic I do

Col1 = 5

with no type of SEL The recordset will go from 5, through to 10 ? no need to set an upper limit on SEL-RANGE.
Unless I'm missing somethine else ;)

#7 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 09 January 2007 - 09:49 AM

I don't see why there needs to be any kind of SEL to do this.


True, technically, no there is no difference...

However, I like to make code as clear as possible, and using the SEL-RANGE() does this a bit, I think...

I just makes it really clear to anyone else that its supposed to be reading to the end of the range

Just a preference of mine...

Rob.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users