using ROWID and asterisk in google fusion tables API SELECT statement
Asked Answered
L

1

7

I'm trying to get the ROWID as well as all the data back for each row in a Google Fusion Tables.

This select statement:

SELECT *, ROWID FROM [tableID] 

results in this error:

"domain": "fusiontables",
"reason": "badQueryCouldNotParse",
"message": "Invalid query: Parse error near '*' (line 1, position 14).",
"locationType": "parameter",
"location": "q"

If I specify the column names, eg...

SELECT ROWID, name, city, suburb, etc FROM [tableID] 

...where etc is all the column names, it works fine. Thing is, I've got a lot of column names, and will be adding/deleting them as time goes on, and don't want to have to update that select statement every time I do.

Is the ROWID + asterisk wildcard SELECT statement possible?

(I realise I could probably do this by using the DESCRIBE query to get all the column names, and creating my query from there, but I'd like to get the number of calls down to a minimum, if possible).

Lindholm answered 17/7, 2012 at 4:35 Comment(5)
I think at the moment you have to use the workaround to make two calls (using DESCRIBE or the new REST-API). Maybe you could cache the result to reduce the amount of calls per day (i.e. check every day if there are new/different columns).Housewife
Thanks Odi. Good idea on the caching -- I'll roll with that solution for now.Lindholm
It's very odd indeed. I wouldn't mind if Fusion Tables just returned the ROWID with every query regardless of whether it was requested. But being able to either get it OR * (or both if you know every column name) is a little annoying.Zibet
I'm trying to do exactly the same as the OP. Has anyone made progress on this, or do I have to just query for the column names and just list them?Pericycle
Hi @Phlucios - my code is still using the system described above (using a DESCRIBE call then using that to create my SELECT query). I haven't had a chance to re-examine the API recently though, so do let us know if you find an easier way of solving the original problem.Lindholm
F
0

You should use this:

SELECT ROWID FROM [Table ID] WHERE [NameColum]='Data'

and you will get the ROWID from that row where "data" is found. And then you could use the ROWID to call the whole row.

Fiend answered 18/4, 2015 at 12:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.