简体   繁体   中英

Sample insert into statement aws timestream DB

Is there any sample insert into statement available to insert data to aws timestream tables. I am getting invalid syntax error.

Also aws documentation only provides samples with programming languages (Java,GO,Node,python) not SQL

AWS Timestream does not support the INSERT or any DDL and DML SQL statements. Data insertion into AWS Timestream is supported using AWS SDK.

Inserts are currently (Dec 29 2022) supported via the WriteRecords API only, which can either be called directly via the SDK, or via the CLI.

Below is an example for doing it via the CLI. For examples using the API, best refer to the documentation as that provides code samples in various programming languages.

CLI ( reference )

aws timestream-write write-records \
    --database-name mydatabase \
    --table-name mytable \
    --records '[{"Dimensions":[{"DimensionValueType": "VARCHAR","Name": "device-id","Value": "abc123"}],"MeasureName":"temperature","MeasureValue":"98.76","TimeUnit":"SECONDS","Time":"1672329484"}]'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM