Re: [gnome-db] Per-table meta-data with capital letters in the table name?





2009/6/30 Murray Cumming <murrayc murrayc com>
On Tue, 2009-06-30 at 09:08 +0200, Vivien Malerba wrote:
> note that there is also a
> gda_sql_identifier_remove_quotes() function.

From
http://library.gnome.org/devel/libgda/unstable/GdaSqlParser.html#gda-sql-identifier-remove-quotes
:
"
Prepares str to be compared: - if surrounded by double quotes or single
quotes, then just remove the quotes - otherwise convert to lower case
"

Why on earth does that covert to lower case if there are no quotes. That
means that my string will be changed if I call this on a string that has
no quotes. That's so annoying.

This function is intended to be used for SQL identifiers, not SQL literal values. For SQL identifiers you don't care how they are represented as long as they represent the correct object: for example the *myTable* object is the same as the *mytable* object (I used asterixes to avoid any confusion with double quotes).
 


And there's no has_quotes() function to help me decide to call it. I
guess !gda_sql_identifier_needs_quotes() might do it, but first that
function would have to be documented to say what it actually checks for.
How can it know when something _needs_ quotes?

You don't need any has_quotes() function for SQL identifiers (again because they are not SQL literal values).




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]