TSTool / Command / WriteTimeSeriesToDataStore
Overview
The WriteTimeSeriesToDataStore
command writes time series to the specified database datastore.
This command can only write to databases that have a supported design structure.
Currently this command is only available for generic datastores (see the
Generic Database Datastore appendix
for information about supported database designs and datastore configuration properties).
This command cannot be used with web service datastores and use with Excel datastores has not been tested.
This command is useful in particular for bulk data loading such as for database
initialization and when tight integration with TSTool is not required or has not been implemented.
Command Editor
The command is available in the following TSTool menu:
- Commands / Output Time Series
The following dialog is used to edit the command and illustrates the syntax of the command.
WriteTimeSeriesToDataStore
Command Editor (see full-size image)
Command Syntax
The command syntax is as follows:
WriteTimeSeriesToDataStore(Parameter="Value",...)
Command Parameters
Parameter | Description | Default |
---|---|---|
TSList |
Indicates the list of time series to be processed, one of:
|
AllTS |
TSID |
The time series identifier or alias for the time series to be processed, using the * wildcard character to match multiple time series. Can be specified using ${Property} . |
Required if TSList=*TSID |
EnsembleID |
The ensemble to be processed, if processing an ensemble. Can be specified using ${Property} . |
Required if TSList=*EnsembleID |
OutputStart |
The date/time for the start of the output. Can be specified using ${Property} notation. |
Use the global output period. |
OutputEnd |
The date/time for the end of the output. Can be specified using ${Property} notation. |
Use the global output period. |
DataStore required |
The name of a database datastore to receive data. | None – must be specified. |
DataStoreLocationType |
The location type to match in the datastore. Can be specified using ${Property} notation. |
Location type from time series is used. |
DataStoreLocationID |
The location identifier to match in the datastore. Can be specified using ${Property} notation. |
Location identifier from time series is used. |
DataStoreDataSource |
The data source (provider) to match in the datastore. Can be specified using ${Property} notation. |
Data source from time series is used. |
DataStoreDataType |
The data type to match in the datastore. Can be specified using ${Property} notation. |
Data type from time series is used. |
DataStoreInterval |
The data interval to match in the datastore. Can be specified using ${Property} notation. |
Data interval from time series is used. |
DataStoreScenario |
The scenario to match in the datastore. Can be specified using ${Property} notation. |
Scenario from time series is used. |
DataStoreMissingValue |
The value to write to the datastore to indicate a missing value in the time series. Specify null to write null to the database. | Missing value used for the time series will be used (e.g., NaN , -999 ). |
DataStoreUnits |
Units to use for time series in the database, currently not used. Time series data must match the time series as defined in the database. Can be specified using ${Property} notation. |
|
WriteMode |
The method used to write time series data records, recognizing the databases use insert and update SQL statements. Note that any insert/update actions only occur on exact matches of date/time, not on a period. For example, DeleteInsert only deletes records that match the specific date/time of a value in the time series. Specify WriteMode as:
|
InsertUpdate |
Examples
See the automated tests.
Troubleshooting
See the main TSTool Troubleshooting documentation.
See Also
ReadTimeSeriesFromDataStore
commandSelectTimeSeries
command