FNC_UdtSerialize Function | C Library Functions | Teradata Vantage - FNC_UdtSerialize - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Returns the UDT in its serialized format.

Syntax

int
FNC_UdtSerialize (UDT_HANDLE        udt,
                  BYTE             *buffer,
                  FNC_LobLength_t   num_bytes,
                  FNC_LobLength_t  *actual_length)
UDT_HANDLE udt
the handle of the UDT.
BYTE *buffer
the user-allocated buffer that will contain the serialized data.
FNC_LobLength_t num_bytes
the number of bytes to read.
FNC_LobLength_t *actual_length
the actual number of bytes that were written to the buffer.

Return Value

  • 0 : the operation was successful
  • -1 : the operation was not successful

Usage Notes

Before calling this function, do the following:

  1. Call FNC_UdtGetSerializeSize to get the size of the UDT in its serialized form.
  2. Use the size returned by FNC_UdtGetSerializeSize to allocate a buffer that will hold the serialized data. The size of the buffer must be large enough to hold all of the serialized data, which must be read in a single call to FNC_UdtSerialize.
  3. Pass this buffer to FNC_UdtSerialize.

The query will fail if the UDT does not support serialize/deserialize.