Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook FQL Query (#601) Parser error: unexpected '#' at position 58

it's the first time I'm not able to find a solution for an error on my own. I try to perform a fql query but I', getting a very strange response :/

FQL:

{
  "477215715631180":
      "SELECT name, start_time, location, creator, pic_square 
       FROM event WHERE eid=477215715631180",
  "creator_477215715631180":
      "SELECT name FROM profile WHERE id IN (SELECT creator FROM #477215715631180)"
 }

Response:

(#601) Parser error: unexpected '#' at position 58.

Position 58:

... FROM event WHERE ...

API Explorer.

Is there anybody with a solution?

like image 296
Philipp Woe Avatar asked Oct 06 '22 21:10

Philipp Woe


1 Answers

The problem seems to be that you can't have a sub-query named the same as a reserved FQL item. You're using an id for your query designator here. Facebook doesn't like that.

I was able to get your query to run by adding a 'q' to the beginning of your subquery name:

{
  "q477215715631180":
      "SELECT name, start_time, location, creator, pic_square 
       FROM event WHERE eid=477215715631180",
  "creator_477215715631180":
      "SELECT name FROM profile WHERE id IN (SELECT creator FROM #q477215715631180)"
}

For your parser error, Facebook's messages don't reference the whole FQL multiquery. Facebook parses each query individually and throws an error just for the current query it's parsing. So in your case, the first query parsed fine, then this error came from your creator_ query, where the # occurs at position 58.

like image 96
cpilko Avatar answered Oct 10 '22 01:10

cpilko