Extract all TAG data
If there is no special condition as described above, data can be extracted for each tag arranged in each time order.
Extract data for a specific tag name
Below is an example of data with TAG name TAG_0002.
Query for time range
The following is a query of a time range for TAG_0002 and receives data.
It is common practice to use the between clause to give a time range. Of course, you can get the same result by typing the time range with time < or >.
Time range search for multiple tags
Below is an example of retrieving the same time range data for two or more tags.
If you want to get fast results for a large number of tags at the same time, it is preferable to perform the following type of query.
Search data over a certain value
The conditions for the tag value can also be given as follows.
Filtering was performed for those values greater than 12 and less than 15 among the values of TAG_0002.
Extracting Data via RESTful API
Preparations for the RESTful API
You must run Machbase Web Analyzer (MWA) to make the Web service available, and then do the following:
RESTful API calling conventions
|TagName||Name of tag, If you want to specify multiple TagName, They should separated by comma(',').|
|Start, End||Duration. Formats supported are YYYY-MM-DD HH24:MI:SS or YYYY-MM-DD or YYYY-MM-DD HH24:MI:SS,mmm (mmm: millisecond, if it is omitted start is 000, End is 999, micro second and nano seconds are also 999).If you specify as a string, add 'T' between date and time to remove space.|
|Direction||Currently, only 0 (ascending) is supported.|
|Count||Limit number of rows. if you specify 0, all of the rows are retrieved.|
|Offset||Starting offset (default : 0)|
A sample of importing single tag data via CURL
If you make a call to Machbase installed on 192.168.0.148 as shown below, you can import the data from the web.
Importing multiple tag data via CURL
Below is a sample example that gets the values for the two tags.
Specifying Scan Direction with Hint
In general, TAG table query retrieves the oldest record first. When the newest record is to be retrieved, the scan direction can be specified with SELECT HINT.
Forward scanning is possible with /*+ SCAN_BACKWARD(table_name) */ hint.
Backward scanning is possible with /*+ SCAN_BACKWARD(table_name) */ hint.
Property to Set Default Direction
The defualt direction of scan can be set with DISK_SCAN_DIRECTION property. The value can be 0 or 1. Default value is 1.
The scan direction is forward with 1, and backward with 0, when no hint was given in SELECT phrase.