tdr.LobAppend Function | R Table Operators | Teradata Vantage - tdr.LobAppend - 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

Appends raw data to the end of the output LOB associated with a specified output locator.

Syntax

tdr.LobAppend(  locator,  data)
locator
Parameter type: integer

The output locator returned by the tdr.LobCol2Loc function.

data
Parameter type: raw

A vector with raw data to be appended to the output LOB.

Return Value

A status code.

Usage Notes

Before you call this function, you must call the tdr.LobCol2Loc function to get the output locator for the LOB where the data will be appended.

This function is valid only if called from the table operator.

An error is raised if the function is called from the contract function.

Example: Store an R Data Structure as a LOB in a Table

This example shows how an R data structure can be stored as a LOB in a table with two attributes: (int, blob):

  1. Call the glm R function to compute a model and return an R data structure.
  2. Serialize the data structure.
  3. Store the data structure in the second column of the current output row.
    lin_model <- glm(cc_rev ~ income + age + avg_ck_bal + avg_sv_bal, data = training)
    slin_model <- serialize( lin_model, NULL )
    loc <- tdr.LobCol2Loc(0,1)
    return_value <- tdr.LobAppend (loc, slin_model)