avoid insert device data into database failed
The presence of a colon ':' in the table name will result in the following error message iotsharp-iotsharp-1 | info: IoTSharp.Storage.TaosStorage[0] iotsharp-iotsharp-1 | INSERT INTO device_d2da441304a04ce1924410033e671235_gonglu: USING telemetrydata TAGS('d2da441304a04ce1924410033e671235','功率') (ts,value_type,value_double) values (now,3,0) iotsharp-iotsharp-1 | device_d2da441304a04ce1924410033e671235_kaiguan USING telemetrydata TAGS('d2da441304a04ce1924410033e671235','开关') (ts,value_type,value_double) values (now,3,1) iotsharp-iotsharp-1 | device_d2da441304a04ce1924410033e671235_yongdianliang USING telemetrydata TAGS('d2da441304a04ce1924410033e671235','用电量') (ts,value_type,value_double) values (now,3,164700541) iotsharp-iotsharp-1 | device_d2da441304a04ce1924410033e671235_dianya USING telemetrydata TAGS('d2da441304a04ce1924410033e671235','电压') (ts,value_type,value_double) values (now,3,5065) iotsharp-iotsharp-1 | device_d2da441304a04ce1924410033e671235_dianliu USING telemetrydata TAGS('d2da441304a04ce1924410033e671235','电流') (ts,value_type,value_double) values (now,3,951979566) iotsharp-iotsharp-1 | fail: IoTSharp.Storage.TaosStorage[0] iotsharp-iotsharp-1 | d2da4413-04a0-4ce1-9244-10033e671235数据处理失败9731-Table does not exist iotsharp-iotsharp-1 | IoTSharp.Data.Taos.TaosException (0x00002603): Table does not exist iotsharp-iotsharp-1 | at IoTSharp.Data.Taos.TaosException.ThrowExceptionForRC(TaosErrorResult taosError) iotsharp-iotsharp-1 | at IoTSharp.Data.Taos.Protocols.TDWebSocket.TaosWebSocket.Execute(String _commandText) iotsharp-iotsharp-1 | at IoTSharp.Data.Taos.Protocols.TDWebSocket.TaosWebSocket.ExecuteReader(CommandBehavior behavior, TaosCommand command) iotsharp-iotsharp-1 | at IoTSharp.Data.Taos.TaosCommand.ExecuteNonQuery() iotsharp-iotsharp-1 | at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken) iotsharp-iotsharp-1 | --- End of stack trace from previous location --- iotsharp-iotsharp-1 | at IoTSharp.Storage.TaosStorage.StoreTelemetryAsync(PlayloadData msg) in /src/IoTSharp.Data.TimeSeries/TaosStorage.cs:line 225
Showing
想要评论请 注册 或 登录