tdr.LobAppend Function | R Table Operators | Teradata Vantage - tdr.LobAppend - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

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

Syntax

tdr.LobAppend(  locator,  data)

Syntax Elements

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.

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)