From m@cqueen1 @end|ng |rom ||n|@gov Thu May 21 20:39:12 2015 From: m@cqueen1 @end|ng |rom ||n|@gov (MacQueen, Don) Date: Thu, 21 May 2015 18:39:12 +0000 Subject: [R-sig-DB] Help with RMySQL warning message "Decimal MySQL column 1 imported as numeric" Message-ID: I recently upgraded to R 3.2.0 on a linux box (not my main machine), and then installed RMySQL. I now get the following warning messages from RMySQL that I had not previously. > dbm <- MySQL() > con <- dbConnect(dbm, {other args}) > bah <- dbGetQuery(con, 'select * from gms order by sord') Warning messages: 1: In .local(conn, statement, ...) : Decimal MySQL column 1 imported as numeric 2: In .local(conn, statement, ...) : Decimal MySQL column 2 imported as numeric For the table in question mysql> describe gms; +--------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+---------------+------+-----+---------+-------+ | sens | varchar(10) | NO | PRI | | | | latitude | decimal(15,9) | YES | | NULL | | | longitude | decimal(15,9) | YES | | NULL | | | northing | float | NO | | NULL | | | easting | float | NO | | NULL | | | direction | varchar(15) | YES | | NULL | | | sord | int(11) | YES | | NULL | | +--------------+---------------+------+-----+---------+-------+ I suspect the latitude and longitude fields are responsible for the warnings. This all happens within a script run as a frequent cron job, with the result that the warning messages cause cron to send me many emails. Of course, I can wrap the expression in suppressWarnings(), but I would prefer if possible to handle this by telling dbGetQuery that this conversion really is ok and I don't need a warning. Is this possible? Further version information: With R 3.2.0 I have RMySQL and DBI versions 0.10.3 and 0.3.1 respectively. Previously, with R 3.1.2, it was 0.9-3 and 0.3.1 respectively. I can supply sessionInfo() if needed. If it helps, the same warnings are generated by dbSendQuery() and dbReadTable() I have spent some time with the help pages, looked at RMySQL.pdf, without success. Thanks -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 From pg||bert902 @end|ng |rom gm@||@com Mon Jun 29 16:59:36 2015 From: pg||bert902 @end|ng |rom gm@||@com (Paul Gilbert) Date: Mon, 29 Jun 2015 10:59:36 -0400 Subject: [R-sig-DB] DBI documentation Message-ID: <55915D58.2090804@gmail.com> Hadley ?dbConnect says drv: an object that inherits from ?DBIDriver?, or a character string specifying the name of DBMS driver, e.g., "RSQLite", "RMySQL", "RPostgreSQL", or an existing ?DBIConnection? object (in order to clone an existing connection). and further down manner. For instance ?dbConnect("MySQL")? produces an object of The inconsistency, "RMySQL" vs "MySQL", has probably existed for a long time, but I seem to recall that the character specifications no longer work. Certainly they are no longer the preferred approach. Am I wrong on that? ?dbConnect also says ...: authorization arguments needed by the DBMS instance; these typically include ?user?, ?password?, ?dbname?, ?host?, ?port?, etc. For details see the appropriate ?DBIDriver?. I am trying to find details for the MySQL driver and it is less than obvious where that would be. (Trying to verify if the complete argument name is "user" or "username" for MySQL.) Could "For details see the appropriate ?DBIDriver?" be expanded? It is not really even obvious how to print out the correct function to get this information from the code. Thanks, Paul