Skip to content

Empty

Returns an empty DataTable for importing data into a target table.

1
$Database.Empty(query: Query):DataTable

Parameters

Query query
    The query that specifies the target table and schema for the empty data table.

Returns

An empty DataTable instance.

Remarks

This method is used to create an empty data table for importing data into a target table without querying the database first.

Get an Empty Data Table:

1
2
3
4
5
6
7
var myTable = $Database.Empty({
    TargetSchema : 'HR',
    TargetTable : 'Groups'
});
myTable.Add({Id : 'A', Name : 'Admin'});
myTable.Add({Id : 'U', Name : 'User'});
myTable.Save();

See Also