Arrays vs. Temp-Tables

KMoody

Member
I've heard it's better to use temp-tables than arrays, but what are some reasons why?

I can think of a couple (easier access to data and not needing to worry about extents or out of range exceptions), but what are some others?
 
1) In general, expanding array extents is painful, whereas, adding another temp-table record is business as usual. This would be my #1 reason.

2) Arrays are frowned upon, and in many cases not really supported, in the SQL (IBM, MSFT, ORCL etc.) world ... so, if you want to be compatible with the world outside Progress... either technically or professionally... well, there's another reason.
 
These are my 2 cents:

For variables for which I exactly know how many extents there will be - usually a small number - it is perfectly reasonably to me to use extents. As soon as the data gets more complex and the exact number is not known at design time I will always use a temp-table.

Heavy Regards, RealHeavyDude.
 
I used to feel that days of the week and months of the year were reasonable uses of arrays. But that was before the ENTRY() function came along.
 
That's not enough?
Oh no, that's plenty. :D It's just good to know all the reasons, especially when I'm simplifying decades old code that never used temp-tables (or arrays in some cases!) before. Knowing why temp-tables are usually the best choice makes me feel better about overhauls.
 
Back
Top