views:

43

answers:

3

I'd like to create a gql query through my browser dashboard to easily look up specific entries, i.e. something like:

SELECT * FROM MyEntity where mString = "SpecificEntity"

but I can't quite get the syntax right. I see a lot of examples using parameter binding/substitution (not sure what it is called), but I don't know how to simply just write it directly without getting an error when I try to query. Any help?

Update: This was for Python (and answered nicely already).

+2  A: 

Some (python) examples from here:

query = GqlQuery("SELECT * FROM Song WHERE composer = 'Lennon, John'")

query = GqlQuery("SELECT __key__ FROM Song WHERE composer = :1", "Lennon, John")

query = GqlQuery("SELECT * FROM Song WHERE composer = :composer", composer="Lennon, John")
sje397
+1  A: 

What sort of error do you get? These are easy to find in the application log (if you've uploaded it) and should tell you what's wrong.

Since you haven't given me a specific example (alongwith your entity structure) all I can point you to is the GQL reference.

Kapil Kaisare
+2  A: 

When in the App Engine dashboard, you have to use single quotes.

SELECT * FROM MyEntity where mString = "SpecificEntity" 

Becomes

SELECT * FROM MyEntity where mString = 'SpecificEntity' 
Gab Royer