VALUES(….) table function

Work in progress….

  1. Yes, this is the same VALUES clause we use with INSERT statement.
    1. VALUES clause is not required for INSERT statement.
  2. But its actually a table function.
    1. It basically takes an array like data (single or multi dimension) as input
    2. and return a temp table as output (same as any other table function).

 

A simple example of INSERT statements:

Insert using values Insert without values
INSERT into XYZ
value(‘A’,’B’),(‘C’,’D’),(‘E’,’F’)
INSERT into XYZ
select * from abc

 

Now, back to values function:

Examples

Select * from table (value(‘A’,’B’)) as ABC

 

Select * from table (value(‘A’,’B’),(‘C’,’D’),(‘E’,’F’)) as ABC

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *