Ordering in Teradata

Database
Enthusiast

Ordering in Teradata

Hi All,

Can any one please explain what "Create Ordering" command does. How it is used to compare UDT Value.

Thanks,
Manu.
1 REPLY
Enthusiast

Re: Ordering in Teradata

This is used to determine sort order for UDT's. Since a UDT is a new data type, you have the option of specifying a different way to sort. An ordering function is required for UDT's that are based on large object data types (CLOB, BLOB). However, you do not need to specify an ordering function for other data types. They will use the ordering for the underlying data type as a default.

As an example, if you were storing JPEG's in a UDT called "JPEG", you could define the sort order to be based on the JPEG size or based on something within the JPEG itself in your ordering function. Then, whenever someone specified an "ORDER BY" on your JPEG column, it would use your routine to return a value to Teradata that will be used for sorting.