Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » How should we deal with SQL column names in conflict with SQL standard keywords
How should we deal with SQL column names in conflict with SQL standard keywords [message #35280] Sat, 28 January 2012 15:28 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, this is something that was sort of omitted in the past, however it seems like it would be worth to support columns names that are in conflict with SQL keywords, like:

select FROM from TABLE


which can be legaly written in SQL as

select "FROM" from TABLE


Obviously, putting " around all SqlId names is relatively simple to do, with little complaint that resulting SQL logs will a little bit harder to read.

Then I was thinking about puttin " only around SqlIds that are in conflict.... potentially slow.

Ha! Maybe put it everywhere and then remove all '\"' from SQL logs? Simple enough.
Re: How should we deal with SQL column names in conflict with SQL standard keywords [message #35296 is a reply to message #35280] Mon, 30 January 2012 08:52 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
With MySQL it's `column-name` (grave accent/backtick), and it's required not only for reserved words but also for names including minus and other ascii characters (not sure which of them are allowed, I always use only alphanumeric chars for names, but have seen names like "prefix-name" in project of my friend).

Logging with quotes doesn't bother me at all, I'm used to read "sanitized" SQL anyway.

Edit: just to be complete, values in MySQL are put into ordinary apostrophe, like 'this'.

Now I see you can also use "ANSI_QUOTE" switch with MySQL to make it work with ordinary "quotes".

http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

[Updated on: Mon, 30 January 2012 08:59]

Report message to a moderator

Previous Topic: How do you develop in U++?
Next Topic: SCGI Class
Goto Forum:
  


Current Time: Thu Mar 28 13:27:30 CET 2024

Total time taken to generate the page: 0.01179 seconds