Empty

Summary

The Empty function returns a virtual or dummy table containing n number of rows and columns. XSQL returns a new table result set each time Empty is called.

Syntax

Empty(Rows=n)

Return Type

Result set

Details

Use Empty to generate a dummy result set. The command is useful for testing function calls and to manufacture result sets.

Examples

select Now() from Empty(Rows=1);
'2015-06-11T17:32:00.00'
select 'This is a unique id: ', UUID() from Empty(Rows=2);
'This is a unique id:', 'e9af13b4-0b8a-43b9-b35d-6489e6daee91'
'This is a unique id:', 'd224758e-5d27-4cdf-842z-5493f3aboz88'
 
/* Insert a 100 row, 2 column result set into a table */
insert into Delta(TableName='delta.some_table', Overwrite=true
select SeqNum(1) as col_1, Now() as col_2 from Empty(Rows=100);

Related Functions

EVAL