Storage.Set
Method | |
---|---|
Module | Storage |
Library | Core |
Action | Set or change the value of the named persistent storage table. |
Parameters |
|
| |
It is not an error to append if the table does not already exist; in this situation the parameter's value is irrelevent. WarningThere is no check that the schema of the appended rows is the same as that of those already there. | |
The range is 1 to the SelectRowsLimit configuration value (100000 by default). This can be specified only if NoteThe truncation behaviour is different for v8.0 and for v8.1 onwards. For v8.0 rows already in the table are never deleted when For v8.1 onwards the new (appended) data is considered more important than the old (original) data, so rows are deleted from the front of the table. Also, after the append there will be no more than | |
Return values |
|
Examples | A simple example. @table = Agent.GetSummary(); Storage.Set(Name: "Agent_Summary.Oct2018", Value: @table); The method overwrites whatever was previously in the table. If you want to accumulate data by appending, these show examples of a task that would be run periodically to record who is logged on at that time. They also return the accumulated data. Version (a) not using Append, up to v5.2 @loggedOnUsers = Users.GetLoggedOnUsers(); @newEntries = SELECT *, datetime("now") AS Timestamp FROM @loggedOnUsers; @storageName = SELECT "LoggedInAudit" AS Name; // Store data @found = Storage.Check(Name:@storageName); IF (@found) @currentEntries = Storage.Get(Name:@storageName); @newEntries = @currentEntries + @newEntries; ENDIF; Storage.Set(Name:@storageName, Value:@newEntries); Storage.Get(Name:@storageName); Version (b) using Append, from v8.0 onwards @loggedOnUsers = Users.GetLoggedOnUsers(); @newEntries = SELECT *, datetime("now") AS Timestamp FROM @loggedOnUsers; @storageName = SELECT "LoggedInAudit" AS Name; // Store data Storage.Set(Name:@storageName, Value:@newEntries, Append:true); Storage.Get(Name:@storageName); |
Platforms |
|
Notes |