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

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
vjt1596846980081.ditamap
dita:ditavalPath
vjt1596846980081.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantageā„¢

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