Project

General

Profile

Actions

Support #3752

closed
HN KD

using where on the find() method in order to query database generate lower case query

Support #3752: using where on the find() method in order to query database generate lower case query

Added by Hanan Natan over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02/03/2015
Due date:
% Done:

0%

Estimated time:

Description

When i describe the database columns in the Wt::Dbo::field i am using a camel case like this:
Wt::Dbo::field(a, Test, "Test");

but when i query the database like this:
find().where("Test = ?").bind("hello");

i get an exception that says that the column name test doesn't exists (you can see that the column name is lowercase).
When i change the column name to lowercase it works.

So the but seems to be in the find<>().where() method where it lowercase the query string.

KD Updated by Koen Deforche over 11 years ago Actions #1

  • Tracker changed from Bug to Support
  • Status changed from New to Resolved

SQL is case-sensitive only when you put column names between quotes. Wt::Dbo will use column names between quotes to make sure that it works, even if they collide with SQL keywords.

The draw-back is that you need to use quotes if your column names aren't all lower-case: .where("\"Test\" = ?")

Koen

KD Updated by Koen Deforche over 11 years ago Actions #2

  • Assignee set to Koen Deforche

KD Updated by Koen Deforche over 11 years ago Actions #3

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom