Archives of the TeradataForum
Message Posted: Fri, 04 Sep 2009 @ 19:10:03 GMT
Subj: | | Re: Volatile tables in macros |
|
From: | | Dempsey, Mike |
I don't think you understand how Teradata works. No matter what order the rows are in when you send them to Teradata the database will store
them in the order it wants to store them in - by hash value.
Even if you created a file that contained the rows in the order you want and loaded that file sequentially they would not be stored in the
database sequentially. Storage order is irrelevant in Teradata - and also in relational database theory.
Unlike Oracle (and many other databases) it is not possible to 'position' to a row and read forward through 'consecutive' rows on disk ... they
simply are not stored that way.
If you want the rows to be in a particular order when you extract them you must use an Order By on the Select statement. Otherwise they will
be returned in (effectively) random order.
Mike Dempsey
|