Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to do changes on Google Fusion Tables (like insert, add table, etc.)
    primarykey
    data
    text
    <p>I would like to write a small Google Chrome extension in which I use gooles fusion tables as a central data base.</p> <p>Using existing tables and data (added via the GooleDoc-Webside) works quite fine (SELECT, SHOW TABLES, DESCRIBE) but if I try to do any changes (for this I need a "POST" request). I always get the following error: <strong>"Missing sql parameter."</strong> I have no Idea why this happens. I tried already alot (e.g. "create table test3(A:number,B:number)", insert .)</p> <p>The code I wrote is the following:</p> <pre><code>function Fusion(readyCallback) { var myObject = { URL : "https://www.google.com/fusiontables/api/query", authToken : null, doGET : function(command,callback) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("get" ,this.URL+"?sql="+encodeURI(command) ,true); xmlhttp.setRequestHeader("Authorization" ,"GoogleLogin auth=" + this.authToken); xmlhttp.onreadystatechange = function() { callback(xmlhttp.responseText); } xmlhttp.send(); }, doPOST : function(command,callback) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("post" ,this.URL ,true); xmlhttp.setRequestHeader("Authorization" ,"GoogleLogin auth=" + this.authToken); xmlhttp.onreadystatechange = function() { callback(xmlhttp.responseText); } xmlhttp.send("sql="+encodeURI(command)); } } // client login authentification var email = "XXX@gmail.com"; var password = "XXX"; var loginURL = "https://www.google.com/accounts/ClientLogin?accountType=GOOGLE&amp;Email=" + encodeURI(email) + "&amp;Passwd=" + encodeURIComponent(password) + "&amp;service=fusiontables&amp;Source=testing"; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("get",loginURL,true); xmlhttp.onreadystatechange = function() { var tmp = xmlhttp.responseText; tmp = tmp.slice(tmp.search("Auth=") + 5, tmp.length); tmp = tmp.replace(/\n/g, ""); tmp = tmp.replace(/\r/g, ""); myObject.authToken = tmp; console.log("authentifiaction token status: "+xmlhttp.statusText); if (readyCallback) { readyCallback(); } }; xmlhttp.send(); return myObject; } </code></pre> <p>If I for example try to do something like this</p> <pre><code>mf.doPOST("INSERT INTO 2664928(ID,Text,Number) VALUES (2,'Hallo',3)",mc) </code></pre> <p>or this</p> <pre><code>mf.doPOST("INSERT INTO 2664928(col4,col0,col1) VALUES (2,'Hallo',3)",mc) </code></pre> <p>with a table, described by this</p> <pre><code>column id,name,type col4,ID,number col0,Text,string col1,Number,number </code></pre> <p>I keep getting this error (the same when I try to create a table)</p> <p>Any suggestions? I am realy confused!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload