Google Fusion表更新SQL查询返回400 ok错误

时间:2015-09-18 10:27:38

标签: jquery angularjs rest google-fusion-tables

插入正常,但我收到更新和删除代码时出错。

$http({
  method: 'POST',
  url: "https://www.googleapis.com/fusiontables/v1/query?sql = UPDATE 1SubDA6g3Mz15DIHWpdec4iQ7sCV13aF7B94tJskK SET id = '2001' WHERE ROWID = "+pid+"&access_token="+$scope.Atoken
})

错误:

domain: "global",
reason: "required",
message: "Required parameter: sql", 
locationType: "parameter",
location: "sql"

2 个答案:

答案 0 :(得分:0)

删除等号周围的空格:“sql =”而不是“sql =”。

答案 1 :(得分:0)

最后,我找到了解决方案。

解决方案:

$http({

method: "POST",

url: "https://www.googleapis.com/fusiontables/v2/query?
access_token="+$routeParams.token,

params: { 

         sql: "UPDATE 1R0f3qRr1Ew-V6rDcmZzrqEXxbCOit SET cId='"+answer.id+"',cName='"+answer.name+"',pass='"+answer.pass+"' WHERE ROWID ='"+detail.rId+"'"    
}

})