Help with qx_query::freeText

Forum for posting problems using QxOrm library

Help with qx_query::freeText

Postby andigor » Fri May 04, 2012 8:51 am

I need to generate such SQL condition - WHERE FLOOR(column_name/100) = number

How can I use qx_query::freeText for this?
andigor
 
Posts: 14
Joined: Wed May 02, 2012 11:53 am

Re: Help with qx_query::freeText

Postby QxOrm admin » Fri May 04, 2012 1:21 pm

I need to generate such SQL condition - WHERE FLOOR(column_name/100) = number
How can I use qx_query::freeText for this?

No need to use qx_query::freeText for that !
You can construct your query directly :
Code: Select all
qx_query query("WHERE FLOOR(column_name/100) = :number");
query.bind(":number", myValue);
// etc...

qx::QxSqlQuery::freeText method must be used only if you start to build your query using C++ style (because you can't mix C++ style and direct SQL string).

You can also try something like this if you prefer, but I'm not sure it will work :
Code: Select all
qx_query query = qx_query().where("FLOOR(column_name/100)").isEqualTo(myValue);


Note : for more details about qx_query class, goto the FAQ of QxOrm library :
http://www.qxorm.com/qxorm_en/faq.html#faq_210
QxOrm admin
 


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 8 guests

cron