Thanks, I did get it to work, it never gave me an error, it just didn't
seem to work, I wasn't sure if I was doing it right, and by substituting
and ugly hack, I found this worked,:
model->setQuery(session_.query< Wt::Dbo::ptr<TheVideo> >("select u from
video u").where("categories = ? AND language =
'en'").bind(categoryQuery), false);
so figured that if I add another bind it should work, then though if
that worked a double where should work also, but when I put it in, I go
nothing out of both,
so I asked the question if I was even doing this right, but the next day
I tried this:
model->setQuery(session_.query< Wt::Dbo::ptr<TheVideo> >("select u from
video u").where("categories = ? AND language
= ?").bind(categoryQuery).bind("en"), false);
and it worked, then I was able to figure out it was the code I was using
in lang, which turned out to be en_US, instead of just en, 
which was a feature I changed in your original code, so I could
implement different dialects of Chinese, but then forgot I did that, 
a rookie mistake with the data, but without an example, I didn't have
much to go on, and overlooked what I was asking it,
if I had tried this
model->setQuery(session_.query< Wt::Dbo::ptr<TheVideo> >("select u from
video u").where("categories = ? AND language = '" + lang +
''").bind(categoryQuery), false);
I would have know it was a data mistake, because this didn't work.
I should point out that I never did find an example like this, I just
figured it should work, it did compile, but it did give me what I asked
for.

I just had to make sure I was doing it right and what was the best way
to do it, 
I did find both work great, not sure which way is the best way, but it
seems they both produce the same results,
I really like this library, but I have a lot to learn, but without
examples, I tend to do stupid things and ask way to many stupid
questions, so sorry about this one,
but just to be clear, given the situation with different database back
ends, it seems the double where clause is more intuitive, 
and elevates the need to use the AND, not knowing if it should be upper
or lower case for that engine,
it would be nice to add this to your dbo test example, as well as wild
card searches,
like most people who will learn this library, they depend on examples
for every situation like this.

Thanks for the help.

On Fri, 2014-07-11 at 10:48 +0200, Koen Deforche wrote:
> Hey,
> 
> 
> 
> 2014-07-10 4:27 GMT+02:00 Jeffrey Scott Flesher Gmail
> <jeffrey.scott.fles...@gmail.com>:
> 
>         select u from video u where categories = 'this' AND language = 'that'
>         
>         These did not work:
>         
>         model->setQuery(session_.query< Wt::Dbo::ptr<TheVideo> >("select u 
> from video u").where("categories = ? AND language = 
> ?").bind(categoryQuery).bind(lang), false);
>         
>         model->setQuery(session_.query< Wt::Dbo::ptr<TheVideo> >("select u 
> from video u").where("categories = ?").bind(categoryQuery).where(language = 
> ?").bind(lang), false);
> 
> 
> Both constructs looks right, but perhaps you need to use "u.categories
> = ?" and "u.language = ?"
> What is the error you get?
> 
> 
> Regards,
> koen
> 
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________ witty-interest mailing list 
> witty-interest@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to