[R-sig-DB] Data type error with RpgSQL on Windows XP SP3 32bit

Xiaobo Gu gux|@obo1982 @end|ng |rom gm@||@com
Sat Nov 6 04:11:50 CET 2010


Hi,
The fetch function in RpgSQL can't handle date column with NULL too,
but it can handle integer, character, timestamp, time, and numeric
columns with NULLs.

Xiaobo

On Mon, Nov 1, 2010 at 3:46 PM, Xiaobo Gu <guxiaobo1982 using gmail.com> wrote:
> It works too, but the original problem still occurs.
>
> con <- dbConnect(pgSQL(classPath="D:\\rtemp\\postgresql-8.4-702.jdbc4.zip"))
>> ct <- 'CREATE TABLE DF ("a" INTEGER, "b" VARCHAR(255), "c" DATE,"d" DOUBLE
>> PRECISION)'
>>  dbSendUpdate(con, ct)
>>
>> DF <- data.frame(a = 1L, b = "Hello", c = Sys.Date(), d = 32)
>> dbSendUpdate(con, "insert into DF values(1, 'Hello', to_date('2000-01-01',
>> 'YYYY-MM-DD'), 32)")
>> res <- dbGetQuery(con, "select * from DF")
>> res
>   a     b          c  d
> 1 1 Hello 2000-01-01 32
>> str(res)
> 'data.frame': 1 obs. of  4 variables:
>  $ a: num 1
>  $ b: Factor w/ 1 level "Hello": 1
>  $ c:Class 'Date'  num 10957
>  $ d: num 32
>>
>
> On Mon, Nov 1, 2010 at 10:33 AM, Gabor Grothendieck
> <ggrothendieck using gmail.com> wrote:
>>
>> On Sun, Oct 31, 2010 at 10:17 PM, Xiaobo Gu <guxiaobo1982 using gmail.com>
>> wrote:
>> > Hi,
>> > What's the versions for all the related components, R, DBI, rJava,RJDBC,
>> > RpgSQL, PostgreSQL JDBC?
>> >
>>
>> I am using the most recent versions of all packages and R 2.11.1
>> Patched on Windows Vista:
>>
>> > packageDescription("RJDBC")$Version
>> [1] "0.1-5"
>> > packageDescription("DBI")$Version
>> [1] "0.2-5"
>> > packageDescription("rJava")$Version
>> [1] "0.8-7"
>> > packageDescription("RpgSQL")$Version
>> [1] "0.1-3.2"
>> > R.version.string
>> [1] "R version 2.11.1 Patched (2010-05-31 r52167)"
>> > win.version()
>> [1] "Windows Vista (build 6002) Service Pack 2"
>>
>> The Windows binary of rJava seems currently not to be available on CRAN:
>> http://cran.r-project.org/web/packages/rJava/index.html
>> but you can build it yourself or get it from R-Forge.
>>
>> Did you try running the reproducible example in my email?  Did it work for
>> you?
>>
>> --
>> Statistics & Software Consulting
>> GKX Group, GKX Associates Inc.
>> tel: 1-877-GKX-GROUP
>> email: ggrothendieck at gmail.com
>
>
>
> On Mon, Nov 1, 2010 at 10:33 AM, Gabor Grothendieck
> <ggrothendieck using gmail.com> wrote:
>>
>> On Sun, Oct 31, 2010 at 10:17 PM, Xiaobo Gu <guxiaobo1982 using gmail.com>
>> wrote:
>> > Hi,
>> > What's the versions for all the related components, R, DBI, rJava,RJDBC,
>> > RpgSQL, PostgreSQL JDBC?
>> >
>>
>> I am using the most recent versions of all packages and R 2.11.1
>> Patched on Windows Vista:
>>
>> > packageDescription("RJDBC")$Version
>> [1] "0.1-5"
>> > packageDescription("DBI")$Version
>> [1] "0.2-5"
>> > packageDescription("rJava")$Version
>> [1] "0.8-7"
>> > packageDescription("RpgSQL")$Version
>> [1] "0.1-3.2"
>> > R.version.string
>> [1] "R version 2.11.1 Patched (2010-05-31 r52167)"
>> > win.version()
>> [1] "Windows Vista (build 6002) Service Pack 2"
>>
>> The Windows binary of rJava seems currently not to be available on CRAN:
>> http://cran.r-project.org/web/packages/rJava/index.html
>> but you can build it yourself or get it from R-Forge.
>>
>> Did you try running the reproducible example in my email?  Did it work for
>> you?
>>
>> --
>> Statistics & Software Consulting
>> GKX Group, GKX Associates Inc.
>> tel: 1-877-GKX-GROUP
>> email: ggrothendieck at gmail.com
>
>




More information about the R-sig-DB mailing list