17.05 - Example: Retrieving Data from a DATASET Column in CSV Format - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

Here is the table definition for this example.

CREATE TABLE myDatasetTable01(
id INTEGER,
csvFile DATASET STORAGE FORMAT CSV);

Then, we insert the following CSV data into this column, where the first line contains the header, columns are delimited by the ampersand character (&) and rows are delimited by the number sign character (#). An ampersand not followed by characters indicates a NULL value.

Item ID&Item Name&Item Color&Item Style&Quantity Purchased&Item Price&Total Price#55&bicycle&red&boys&1&100.00&100.00#88&toy boat&pink&&1&15.10&15.10#105&soap&&&1&0.99&0.99 

This statement retrieves the column data:

SELECT csvFile FROM myDatasetTable01;
csvFile
-------
> Item ID&Item Name&Item Color&Item Style&Quantity Purchased&Item Price&Total Price#55&bicycle&red&boys&1&100.00&100.00#88&toy boat&pink&&1&15.10&15.10#105&soap&&&1&0.99&0.99