So I am currently using the following script to select columns from my table.
var queryText = "SELECT 'NAME','ADDRESS1','ADDRESS2','CITY','STATE_TERRITORY','FULL_ADDRESS','COUNTRY_CODE','PHONE','STORE_TYPE','CATEGORY','DESCRIPTION','BRANDS','START_DATE','END_DATE','LAT','LNG' FROM /mytable/";
queryText = encodeURI(queryText);
var query = "https://www.googleapis.com/fusiontables/v1/query?sql=" + queryText + "&key=/mykey/";
$.ajax({
type: "GET",
url: query,
success: successFunction
});
It works fine, except for when I add the column ‘POSTAL_CODE’ to the select. What happens when I add it is quite strange. The AJAX detects the response as an error, but all of the response indicates that the query was successful, complete with Status = OK and status code = 200, but the ajax function runs the error function instead of the success function.
Can anyone shed light on why this would be? It does the same thing if I do select *. I’ve also tried renaming the column to random names to make sure it wasn’t a reserved word or something. Always the same thing.
In editing up a table to post as an example, I found that only running the code on the first couple hundred lines of the table didn’t reproduce the problem. It seems that there is bad data in that column somewhere creating the problem. Hope this helps somebody in the future!