[R-sig-DB] DBI column names

Sean Davis @d@v|@2 @end|ng |rom m@||@n|h@gov
Sun Jul 22 04:45:30 CEST 2007


Gabor Grothendieck wrote:
> It seems that the DBI package changes column names that have
> dots in them replacing the dots with underscores.  Is this really
> necessary?  I understand that dot is an SQL operator; nevertheless,
> SQLite can handle column names with dots and I suspect other
> databases can too:
> 
> C:\tmp2>sqlite3
> SQLite version 3.4.0
> Enter ".help" for instructions
> sqlite> create table mytable (`my.field` integer);
> sqlite> insert into mytable(`my.field`) values (1);
> sqlite> select `my.field` from mytable;
> 1

Just fyi....

Postgres (works):

test5=# create temp table mytable ("my.field" integer);
LOG:  statement: create temp table mytable ("my.field" integer);
CREATE TABLE
test5=# insert into mytable ("my.field") values (1);
INSERT 0 1
test5=# select "my.field" from mytable;
 my.field
----------
        1
(1 row)

And mysql (works, also):

mysql> create temporary table mytable (`my.field` integer);
Query OK, 0 rows affected (0.04 sec)

mysql> insert into mytable(`my.field`) values(1);
Query OK, 1 row affected (0.00 sec)

mysql> select `my.field` from mytable;
+----------+
| my.field |
+----------+

Sean

|        1 |
+----------+
1 row in set (0.00 sec)




More information about the R-sig-DB mailing list