[R] RODBC & Problems with Sybase Database

Christian Schulz c.schulz at metrinomics.de
Fri May 31 10:51:00 CEST 2002


Jason,
many thanks for this suggestion, but if try

dataSybase  <-  sqlFetch(channel,"DATA.EXPORT_Name")

i get the same error message:

 Error in odbcFetchRows(channel, max = max, transposing = (as != 
"matrix"),  :
        negative length vectors are not allowed

and when i try  dataSybase <-  sqlFetch(channel,DATA.EXPORT_NAME)

i get the not surprinsing message error

Error in sqlFetch(channel, DATA.EXPORT <- NAME) :
        <- should be a name

Curious is, when i export the tables from Sybase Database to MySql Database
and  use then (only via RODBC - not RMySql):
      tabs <-   sqlFetch(channel,"DATA.EXPORT_Name")    it works fine !

A test ( Notice - same tables only with the difference i  importing  the 
Sybase data without any modifications to MySql ):
sqlTables(channel.Sybase)
Error in odbcFetchRows(channel, max = max, transposing = (as != 
"matrix"),  :
        negative length vectors are not allowed

sqlTables(channel.MySql)
works fine  !

P.S. I get the feeling that the Sybase Anywhere Odbc driver is not the 
best and the problem is not RODBC  ;-)

thanks for suggestions and regards,Christian




Jason Turner wrote:

>On Thu, May 30, 2002 at 02:10:55PM +0200, Christian Schulz wrote:
>
>>I follow the recommendation from Prof. Ripley and change the sqlFetch 
>>function, but
>>the error message is the same.
>>My problem is (1.)  that the name of the tables in th db have all the 
>>name structure  DATA.EXPORT_NAME 
>>and i understand that  .EXPORT_NAME cause the problems.
>>
>
>Actually, the *unquoted* symbol _ causes problems.  For compatiblity
>reasons with old S, _ is the same as <-.  I believe they (R-core) are 
>considering removing this nasty bit of syntax.
>
>In the meantime, consider this:
>+++
>## this line is the same as foo <- some <- 1
>
>>foo <- some_1
>>ls()
>>
>[1] "foo"     "some"   
>
>>foo
>>
>[1] 1
>
>>some
>>
>[1] 1
>## with quotes, however, it does what you'd expect if you 
>## didn't know about _
>
>>bar <- "some_1"
>>bar
>>
>[1] "some_1"
>+++
>
>So, you can still have _ , as long as you wrap quotes around it.  This
>will cause problems if your table or coulumn names have quotes in them, 
>but that would be very unusual.
>
>Cheers
>
>Jason
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20020531/575e4361/attachment.html


More information about the R-help mailing list