Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gql query returns BadQueryError: Parse Error

This is my gql code:

data = db.GqlQuery("SELECT * FROM Playlist " + "WHERE tags = :1" + "ORDER BY :2", tag, order)

and I get this error:

BadQueryError: Parse Error: Expected no additional symbols at symbol BY

Does anyone know what I am doing wrong?

thanks for the help J

like image 415
user664546 Avatar asked Aug 12 '26 09:08

user664546


2 Answers

You seem to be concatenating the GQL string for some unknown reason and have missed a space. Try:

data = db.GqlQuery("SELECT * FROM Playlist WHERE tags = :1 ORDER BY :2", tag, order)
like image 104
Chris Farmiloe Avatar answered Aug 14 '26 22:08

Chris Farmiloe


You're missing a space before ORDER.

like image 34
Mat Avatar answered Aug 15 '26 00:08

Mat