16.20 - tdr.GetLocalOrderByDef - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

Purpose

Retrieves the columns in the LOCAL ORDER BY clause of a specified input stream, including the column ordering and a NULLS FIRST/NULLS LAST indicator.

Syntax

tdr.GetLocalOrderByDef(  streamno  )
streamno
Parameter type: integer

The input stream number.

Return Value

A list of triplets, one for each column in the LOCAL ORDER BY clause. Each triplet is a vector that consists of the following:
  • A column name
  • The ordering of the column ("A" = ascending or "D" = descending)
  • An indication of whether NULLS FIRST ("F") or NULLS LAST ("L") was specified for the column

Example: Get the Columns in the LOCAL ORDER BY Clause

Consider the following LOCAL ORDER BY clause for input stream 0:

LOCAL ORDER BY col1 ASC NULLS FIRST, col3 DESC NULLS LAST

The following statement retrieves information about the columns in the LOCAL ORDER BY clause and prints it.

print( tdr.GetLocalOrderByDef( 0));

The output of the print statement is as follows:

[[1]]
[1] "col1" "A"    "F"

[[2]]
[1] "col2" "D"    "L"