If you use the 'Is Empty()' function you can use an if statement to only save the data when the table is not empty:
Example:
dt = Open( "Path\DataTable" );
If( Is Empty( dt ),
// Then Do this if the table is not empty:
dt << Save( "Path\DataTable" )
,
// Else Do nothing
Print( "the table is empty and will not be saved" )
);
I recently stumbled into this error message and was quite surprised.
Then I realized I'd made a new table with only the default "Column 1" and no rows.
I would prefer the table be saved as an empty table, but in my case the solution was as simple as naming the only column when I created the table.
The original report was apparently doing something other than the NewTable() function, so naming the column might have been harder.
sentinelDt = New Table( "sentinel", "private", New Column( "a") ); // needs a col name to save it with no rows!
sentinelDt << save( root || sentinelName );
After some further reading in the forum I realized that the Is Empty() function does not say whether the table has data in it... I saw a comment that it is better to use N Row (dt) to do this:
If( N Row( dt ) == 0,
// then
Print( "Data table is empty" );
// else
Print( "Data table is not empty" );
);