Page 1 of 1

Order of rows in hashed file

Posted: Wed May 20, 2009 3:32 am
by snassimr
Hi !!!

If anyway to preserve order of rows in hashed file according the order they enter the hashed file ?

May be to use different type of hashed file ?

Thanks

Re: Order of rows in hashed file

Posted: Wed May 20, 2009 3:58 am
by sachin1
i think you know that data in hash file is key to data mapping, so i think their can be no way to preserve order.

Posted: Wed May 20, 2009 6:32 am
by chulett
Short answer is 'no'. Longer answer involves including the record number as a data element and doing an SSELECT or 'sorted select' to bring them back out in the input order. Requires an account-based hashed file, from what I recall, however.

Posted: Wed May 20, 2009 11:14 am
by ray.wurlod
Long answer is also "no".
It's the hashing algorithm that governs on which page/group/frame any particular record resides.
As noted, the only way to get sorted data out is to sort those rows.