我不認爲你發佈了正確的代碼。如果我修復了雙「在哪裏」,你的代碼工作得很好。
C:\Users\James>sqlite3 test
SQLite version 3.8.3.1 2014-02-11 14:52:19
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table dashboard (data, title);
sqlite> .schema
CREATE TABLE dashboard (data, title);
sqlite> insert into dashboard ("test","TEMPLATE");
sqlite> update dashboard set data=
...> '{"annotations":{"list":[]},"editable":true,"hideControls":false,"id":30,
...> "nav":[{"collapse":false,"enable":true,"notice":false,"now":false,
...> "refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],
...> "status":"Stable",
...> "time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"],"type":"timepicker"}]}'
...> where where title='TEMPLATE';
Error: near "where": syntax error
sqlite> update dashboard set data=
...> '{"annotations":{"list":[]},"editable":true,"hideControls":false,"id":30,
...> "nav":[{"collapse":false,"enable":true,"notice":false,"now":false,
...> "refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],
...> "status":"Stable",
...> "time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"],"type":"timepicker"}]}'
...> where title='TEMPLATE';
sqlite> select * from dashboard;
{"annotations":{"list":[]},"editable":true,"hideControls":false,"id":30,
"nav":[{"collapse":false,"enable":true,"notice":false,"now":false,
"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],
"status":"Stable",
"time_options": ["5m","15m","1h","6h","12h","24h","2d","7d","30d"],"type":"timepicker"}]}|TEMPLATE
>
這真的是你的代碼?這看起來很奇怪:「... where where title ='TEMPLATE'」我不認爲你可以將where關鍵字加倍。 – ravenspoint
錯誤消息和查詢不匹配。使用複製+粘貼來顯示失敗的確切代碼。 –