Try changing Ikai's code to include the entity name like:
SELECT * from DB WHERE __key__ = KEY('DB','1')
if your key is a number then
SELECT * from DB WHERE __key__ = KEY('DB',1)
Documentation:
an entity key literal, with either a string-encoded
key<http://code.google.com/appengine/docs/python/datastore/keyclass.html#Key>or
a complete
path of kinds and key
names/IDs<http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html>:
- KEY('*encoded key*')
- KEY('*kind*', *'name'/ID* [, '*kind*', *'name'/ID*...])
On Mon, Jan 24, 2011 at 3:14 PM, Marc Herber <[email protected]>wrote:
> Thanks for your help. Unfortunatelly this syntax isn't working at all :(
>
> I tried to run this statement within the datastore viewer but I get an
> error "GQL Query".
> Apart from that the link you posted is for python, but I would need it for
> java. Can you/anybody help me with that too?
>
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.