Table of contents
TOC
Collapse the table of content
Expand the table of content

VALUES Expression (U-SQL)

Michael Rys|Last Updated: 5/15/2018
|
4 Contributors

U-SQL offers the ability to create a table using constant values using the Table Value Constructor VALUES expression that can be used by a SELECT expression’s FROM clause or by INSERT statement as an input rowset. The names for the columns are provided by the SELECT’s mandatory derived table alias or the target table’s columns in the INSERT case.

Syntax
Table_Value_Constructor_Expression :=                                                                    
     'VALUES' Row_Constructor_List.

Semantics of Syntax Elements

  • Row_Constructor_List
    The VALUES constructor takes a list of row constructors that create a value for the column at the given position. Note that each row constructor needs to have the same number of values or an error is raised. The constructor supports up to 1 million constant values. The limit is based on the total count based on the number of rows * number of columns.

    Syntax
    Row_Constructor_List :=                                                                             
         Row_Constructor { ',' Row_Constructor }.
    Row_Constructor := '(' Expression_List ')'.
    Expression_List := expression {',' expression}.

    The types for the columns are inferred from the type of the expression in the first row constructor and has to be one of the U-SQL built-in types. All subsequent row constructors then have to produce the same types for the same columns and if now, they have to be cast or an error is raised. If any of the column values is null, then the type of all expressions for that column in all row constructor has to be nullable.

Examples

See:

See Also

© 2018 Microsoft