[Gambas-devel] Database field name error.

Benoit Minisini gambas at ...1...
Wed Apr 26 23:01:06 CEST 2006


On Friday 21 April 2006 03:24, ron wrote:
> I have a table where one of the fields is named 'group'
> This table has no primary key as need by gambas.
> Using the database manager from gambas to add that key
> does not work. I get a error near ',group from tblname'
>
> The database is a mysql 4.xx db.
>
> Here is group interpreted as a reserved keyword from the
> 'group by' syntax.
>
> This as field name is allowed if the names of
> database, table and field names are between backticks.
>
> While in the past at my work the office people in exel made
> tables with those reserverd column names or even spaces in it
> I have the habbit always to use backticks on db, table and field names.
>
> I suggest to do it in the mysql driver to.
> Adding backticks does not harm but without them it does/can
> create errors for unexperiented people they do not understand.
>
>
> my 3 cents
>
> Ron
>
>

You are right, I should quoting field names everywhere.

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list