Project

General

Profile

Actions

Support #3752

closed

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

Added by Hanan Natan about 9 years ago. Updated about 9 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.

Actions #1

Updated by Koen Deforche about 9 years ago

  • 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

Actions #2

Updated by Koen Deforche about 9 years ago

  • Assignee set to Koen Deforche
Actions #3

Updated by Koen Deforche about 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF