Hi all,
i wrote routine in which i read from hashtable by :
SELECT doneFile to 1
DONE = @FALSE
Loop
Call DSLogInfo('In Loop', 'Job COntrol')
READNEXT key FROM 1 Else DONE = @TRUE
...
the readnext command read by key, but i want read 2 columns from hash where the first column is key.
How i can do it?
Thanks,
Juliya
Read from hashtable
Moderators: chulett, rschirm, roy
Hi,
when you readnext by key you get the reminder of the row returned without hte key value.
you might also want to go over openpath and related commands in your BASIC.pdf file in the docs directory under your installation directory.
you can also search this forum, there are previous posts for handling hash files here.
IHTH,
when you readnext by key you get the reminder of the row returned without hte key value.
you might also want to go over openpath and related commands in your BASIC.pdf file in the docs directory under your installation directory.
you can also search this forum, there are previous posts for handling hash files here.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Juliyas,
What Roy said is not quite right, but pretty close.
The SELECT statement will put a list of all file KEYS into memory. The READNEXT statement gets the next key value from this list until the end has been reached.
With your code you need to add another line to read the contents of the record:
Now the variable InRecord will contain a string with the record contents, with each column as it is defined in the Hash File being separated by the @FM character. So if you want the 2nd column you could use
.
What Roy said is not quite right, but pretty close.
The SELECT statement will put a list of all file KEYS into memory. The READNEXT statement gets the next key value from this list until the end has been reached.
With your code you need to add another line to read the contents of the record:
Code: Select all
READ InRecord FROM doneFile, key ELSE CALL DSLogFatal('Unable to read "':key:'" from input hash file','')
Code: Select all
InRecord<2>
Last edited by ArndW on Mon Apr 04, 2005 9:02 am, edited 1 time in total.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Thanks for the correction ArndW
Kinda hard testing and rechecking everything, I thought I remembered correctly but I guess I mixed something up there
Kinda hard testing and rechecking everything, I thought I remembered correctly but I guess I mixed something up there
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Roy - no problem there, you just overlooked the SELECT memory list. We've all been-there-done-that before.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>