Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions

Transformation Language Reference

Transformation Language Reference

CAST

CAST

Renames the elements and changes the data type of each element for the given struct value based on the data type in the specified complex data type definition.

Syntax

CAST (:Type.type_definition_library.type_definition, struct_value)
The following table describes the arguments for this command:
Argument
Required/Optional
Description
:Type.type_definition_library.type_definition
Required
The complex data type definition that represents the schema of the struct data.
Use the reference qualifier
:Type
to reference the type definition library that contains the complex data type definition.
struct_value
Required
The struct value for which you want to change the data type of the struct elements. You can enter any valid transformation expression that evaluates to a struct.
The data type of the struct value and the data type in the complex data type definition must be compatible.

Return Value

Struct.

Examples

The following expression changes the data types of the elements in the struct port h2_sales based on the data types in the complex data type definition h1_sales_def.
CAST (:Type.type_definition_library.h1_sales_def, h2_sales)
h1_sales_def
h2_sales
RETURN VALUE
{ q1_total : bigint q2_total : double }
{ q3_total : int q4_total : int }
{ q1_total : bigint q2_total : double }

0 COMMENTS

We’d like to hear from you!