Escape %

Login or register to post comments
4 replies [Last post]
Offline
Joined: 06/21/2010

Does qcubed escape the % char in LIKE statements ?

alex94040's picture
Offline
Joined: 11/06/2008

Can you post the code snippet? There's a million ways you could be doing a SQL query in QCubed, so it's hard to tell. I don't recall that it would do the escaping, but to be sure, I need your code snippet to check against the QCubed codebase.

Offline
Joined: 06/21/2010

TestNode::QuerySingle(
QQ::AndCondition(
QQ::Like(QQN::TestNode()->Name, '%Bob%')

)
);

Shouldn't something like this be auto escaped ?

Thanks.

alex94040's picture
Offline
Joined: 11/06/2008

If qq::like was auto-escaping the string parameter, how would you be able to specify a qquery condition that says "begins with Bob?

Offline
Joined: 06/21/2010

Yes, I guess it depends on the case.
Thanks