Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1049727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:39:46+00:00 2026-05-16T16:39:46+00:00

We keep all our laboratory data in a Sybase database. When I want to

  • 0

We keep all our laboratory data in a Sybase database. When I want to do data manipulation and analysis I read the data into R with RODBC.

library(RODBC)
channellab <- odbcConnect("Labdata")
indivs <-sqlQuery(channellab,'SELECT * from CGS.Specimen')

So far so good, except that CGS.Specimen is a table for our entire lab holdings. There are almost 40000 specimens (rows) with 66 variables. It takes an unnecessary amount of time to read especially when I am only interested in the holdings of one study which has about 1000 specimens. The obvious way to fix it would be

indivs <-sqlQuery(channellab,'SELECT * from CGS.Specimen WHERE StudyCode="RP"')  

But when I run that I get

[1] “42S22 -143 [Sybase][ODBC Driver][Adaptive Server Anywhere]Column not found: Column ‘RP’ not found” “[RODBC] ERROR: Could not SQLExecDirect ‘SELECT * from CGS.Specimen WHERE StudyCode=\”RP\”‘”

I have played with quotation marks and I have played with escape slashes but alas I have gotten nowhere.

for instance

indivs <-sqlQuery(channellab,'SELECT * from CGS.Specimen WHERE StudyCode= 'RP'  ')

Error: unexpected symbol in “indivs <-sqlQuery(channellab,’SELECT * from CGS.Specimen WHERE StudyCode= ‘RP”

indivs <-sqlQuery(channellab,"SELECT * from CGS.Specimen WHERE StudyCode= 'RP'  ")

Error in .Call(C_RODBCFetchRows, attr(channel, “handle_ptr”), max, buffsize, :
negative length vectors are not allowed

What do you suggest?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:39:47+00:00Added an answer on May 16, 2026 at 4:39 pm

    The last error you report is from the .Call function to the c function RODBCFetchRows. Thus your problem with the quotation marks appears to be solved. However, with the said error you still have a problem. Perhaps the rows are not correctly reported (the c function tries to allocate vectors based on this value, but does not check for negative values). Try:

    indivs <-sqlQuery(channellab,"SELECT * from CGS.Specimen WHERE StudyCode= 'RP'", believeNRows = FALSE)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got following repeating syntax and I want to keep all <h1> that is
I am parsing a HTML document with XPATH and I want to keep all
I ended up creating my own HTML class, mainly to keep all our output
We asked students in our class to use github to keep all their course
We're using Prototype for all of our Ajax request handling and to keep things
How I can keep all the current formatting for a file type but add
I'm working out the reasonability of a request to keep all documents with executable
I'm working on an HTML class in PHP, so that we can keep all
So, I have three server, and the idea was to keep all media (images,
For my application I need to keep track of all files that are touched

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.