GET___COLUMNBYNAME()

Other. Returns the value of a column identified by an expression evaluated at runtime.

Syntax

GETBLOBCOLUMNBYNAME( name,column ) GETBOOLEANCOLUMNBYNAME( name,column ) GETFLOATCOLUMNBYNAME( name,column ) GETINTEGERCOLUMNBYNAME( name,column ) GETINTERVALCOLUMNBYNAME( name,column ) GETLONGCOLUMNBYNAME( name,column ) GETSTRINGCOLUMNBYNAME( name,column ) GETTIMESTAMPCOLUMNBYNAME( name column ) GETXMLCOLUMNBYNAME( name,column )
Parameters

name

The name of a stream or window included as a data source in the query's FROM clause.

column

An expression that evaluates at runtime to the name of a column of the type specified in the name of the function, in the stream or window specified with name. If NULL or the specified column doesn't exist, the function returns NULL and generates a warning message.

Data Types

Return

name

column

As specified in the function name

String

String

Examples

In the following example, the WinningPhotos stream includes several BLOB columns, each of which contains photos from one of three artists in a given category. A Winner STRING column specifies the column that contains the image that won the category prize in each row. The OutStream stream captures only the winning photos by capturing only the contents of whichever column contains the winning image.

INSERT INTO OutStream
SELECT GETBLOBCOLUMNBYNAME(WinningPhotos, Winner)
FROM WinningPhotos;

In the following example, each row of the TestAnswers stream includes several BOOLEAN columns, which contain true or false answers. All answers except one in each row are false. The Correct column specifies which column contains the true answer for the row. The correct answers are published to the OutStream column based on the values contained in the Correct column.

INSERT INTO OutStream
SELECT GETBOOLEANCOLUMNBYNAME(TestAnswers, Correct)
FROM TestAnswers;

In the following example, each row of the Prices stream includes an item listing along with a range of prices. The Preferred column specifies which column contains the price preferred by the buyer for the item in question. The preferred prices are published to OutStream:

INSERT INTO OutStream
SELECT GETFLOATCOLUMNBYNAME(Prices, Preferred)
FROM Prices;

In the following example, each row of the ContactInformation stream includes a listing for each contact's home, business, and mobile phone numbers. The PrimaryPhone column specifies which of these three numbers is considered the main number for the contact, by listing the column name in which the number appears:

INSERT INTO OutStream
SELECT GETINTEGERCOLUMNBYNAME(ContactInformation, PrimaryPhone)
FROM ContactInformation;

In the following example, each row of the stream UtilitySettings includes several INTERVAL columns listing possible wait times associated with a utility. The preferred wait time is listed as a reference to the appropriate column name in the PreferredWaitTime column. The value associated with the specified column is published to OutStream:

INSERT INTO OutStream
SELECT GETINTERVALCOLUMNBYNAME(UtilitySettings, PreferredWaitTime)
FROM UtilitySettings;

In the following example, each row of InStream includes several LONG columns. Each row also contains a Choice column listing the name of one of the LONG columns. The value associated with the specified column is published to OutStream:

INSERT INTO OutStream
SELECT GETLONGCOLUMNBYNAME(InStream, Choice)
FROM InStream;