SQL Notebook (logo)

READ_CSV Function

Reads a CSV file line-by-line and returns it in a table.

This table-valued function is used in the FROM clause of a SELECT statement and can participate in JOINs as if it were a table. However, it cannot be used in a CREATE TRIGGER statement. Internally, the READ_CSV function is translated into an IMPORT CSV statement that runs prior to the statement that contains the READ_CSV call.

Syntax

READ_CSV(file-path[has-header-row], [skip-lines], [file-encoding])

Arguments

Return Value

A table with columns defined by the input file.

Examples