17.10 - Getting and Setting the Time Zone in a Java Table Operator - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

You can get or set the time zone value in a Java table operator.

To get the time zone value, do the following:

  1. Call getTime() or getTimestamp() and check that the return type is TeradataTime or TeradataTimestamp.
  2. If the return type is TeradataTime or TeradataTimestamp, call getTimeZone() on the object to get the time zone.

To set the time zone value, do the following:

  1. Create a TeradataTime or TeradataTimestamp object.
  2. Call setTimeZone() on the TeradataTime or TeradataTimestamp object, and pass the result to updateTime () or updateTimestamp() as the second parameter.
TeradataTime and TeradataTimestamp are used to get and set the time zone in Time with Time Zone and Timestamp with Time Zone values in the input or output rows. They are used only with Java table operators. For information about using Time with Time Zone and Timestamp with Time Zone as parameter and return types in a Java table operator, see SQL to Java Data Type Mapping.