Hi Nick,

Thank you for your answer.

My first topic has typo error:
should be
I would like to do "select * from TABLE1 where FIELD in (key('TABLE2',
VALUE1), key('TABLE2', VALUE2))"
instead of
I would like to do "select * from TABLE1 where FIELD in (key('TABLE1',
VALUE1), key('TABLE1', VALUE2))"

I checked way you described with successful result but it seems that
it is not helpful for me.
In my case a potential user is aware of GQL syntax and prefer to type
long gql construction and use one to query datastore. I would like to
allow him to make something like following:
select * from TABLE1 where FIELD in (select __key__ from TABLE2
where ...)
to get true KEYs replaced  (select __key__ from TABLE2 where ...) with
(key1, key2)
getting result gql line as select * from TABLE1 where FIELD in (key1,
key2)
Unfortunately parameter usage is not comfortable way in my case.
Do you know a reason why in(key1, key2) syntax is not supported in gql
line?

Thanks


On Sep 1, 5:10 pm, "Nick Johnson (Google)" <[email protected]>
wrote:
> Hi igor,
>
> The IN operator supports keys, but you will probably have to use parameter
> substitution in order to achieve it (which is the correct approach when
> dealing with user input anyway). For example:
>
> db.GqlQuery("SELECT * FROM Kind WHERE akey IN :1", [key1, key2, key3]).
>
> -Nick Johnson
>
>
>
> On Tue, Sep 1, 2009 at 1:32 PM, igor <[email protected]> wrote:
>
> > I'd really appreciate some help from experienced guys.
> > Does GQL IN() support list from keys?
> > Is there a workaround to do it possible?
>
> > Thanks
>
> > On Aug 26, 8:11 pm, igor <[email protected]> wrote:
> > > Hi,
>
> > > I have met issue I can not solve.
> > > It does look like current GAE limitation. In case I am right I would
> > > like to get fresh idea to prepare workaround.
>
> > > Issue:
> > > I have two tables as TABLE1 and TABLE2.
> > > TABLE1 has FIELD as reference property to TABLE2
>
> > > I can execute GQL query as "select * from TABLE1 where FIELD=key
> > > ('TABLE1', VALUE1)"
>
> > > I would like to do "select * from TABLE1 where FIELD in (key('TABLE1',
> > > VALUE1), key('TABLE1', VALUE2))" but get error
> > > 'Parse Error: Parameter list requires literal or reference parameter
> > > at symbol key'
>
> > > How can I achieve my purpose?
>
> > > Thanks
>
> --
> Nick Johnson, Developer Programs Engineer, App Engine
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to