No value specified for parameter ..... ".

Abou5 years ago

Hi,
I use traccar 4.6 and i want to insert som data to another table when receive a new position (table tc_position)
this is my configuration in config/traccar.xml

 <entry key='database.insertPosition'>

        START TRANSACTION;

        SELECT @accountID := accountID, @objectID := isAttached FROM tc_devices WHERE id = :deviceid;

        INSERT INTO eventdata (accountID, objectID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, heading, altitude, rawData, creationTime, address, batteryVolts)

        VALUES (@accountID, @objectID, :deviceid, :servertime, 0, :latitude, :longitude, speed*1.852, :course, :altitude, :extended_info, UNIX_TIMESTAMP(NOW()), :address, :accuray);


        COMMIT;

    </entry>

Here is a snippet of error log

2020-04-14 13:56:21  WARN: Failed to store position - No value specified for parameter 8 - SQLException (... < QueryBuilder:480 < DataManager:458 < DefaultDataHandler:40 < ...)
2020-04-14 13:56:21  INFO: [c0419760] id: 359710047375937, time: 2020-04-14 13:56:18, lat: 18.09705, lon: -15.96313, course: 0.0
2020-04-14 13:56:51  INFO: [c0419760: gps103 < 41.188.67.171] HEX: 696d65693a3335393731303034373337353933372c747261636b65722c3230303431343231353635302c2c462c3133353634382e3030302c412c313830352e383233322c4e2c30313535372e373837392c572c302e30302c303b
2020-04-14 13:56:51  WARN: Failed to store position - No value specified for parameter 8 - SQLException (... < QueryBuilder:480 < DataManager:458 < DefaultDataHandler:40 < ...)
2020-04-14 13:56:51  INFO: [c0419760] id: 359710047375937, time: 2020-04-14 13:56:48, lat: 18.09705, lon: -15.96313, course: 0.0

I can't understand what went wrong. Any help please?

Anton Tananaev5 years ago

There is no extended_info. It has been removed a very very long time ago. Also, what is accuray?

Abou5 years ago

what i can use instead of extende_info. And can you help me to write a dynamic query, buceause i use MYSQL DB

Anton Tananaev5 years ago

You can try attributes instead.