Results 1 to 7 of 7

Thread: Queries returning wrong result after upgradation to SQL anywhere 11

  1. #1
    Join Date
    Dec 2008
    Posts
    3

    Queries returning wrong result after upgradation to SQL anywhere 11

    We have upgraded DB from Sybase 6.0 to SQL Anywhere 11.
    After upgradation we are facing a few issues.
    One of them is as follows :

    Please have a look at the attached DB.

    While running the below query, the count returned is 0.
    If we remove the //
    in the below query,
    the count is properly returned as 4.


    Could you please let us the resolution for the same. We are badly stuck up.


    Query:

    SELECT count(*)

    from dba.tblcompmst ,

    dba.employeemastercompany //WITH (NO INDEX)

    WHERE

    dba.tblcompmst.ncocodegrp = dba.employeemastercompany.ncocodegrp and

    dba.tblcompmst.ncocode = dba.employeemastercompany.ncocode and

    dba.employeemastercompany.ncocodegrp = 2 AND

    dba.employeemastercompany.employeeno =110 AND

    dba.tblcompmst.ncostatus = 1

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    I don't know much about Sybase, but is //WITH (NO INDEX) a valid syntax in new version?

    Also you may try rebuilding index on employeemastercompany.

  3. #3
    Join Date
    Dec 2008
    Posts
    3
    With (no index) is valid in SQL Anywhere Version 11. I rebuilt the indexes too .. But still facing the issue.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Is // valid in sqlanywhere 11?

  5. #5
    Join Date
    Dec 2008
    Posts
    3
    // is for comment.

    If we remove // then with (no index) clause is included in the query and the results are properly returned.

  6. #6
    Join Date
    Sep 2002
    Posts
    5,938
    Tried update stats?

  7. #7
    Join Date
    Dec 2008
    Posts
    1
    Have you tried validating the database to make sure there wasn't a problem with the rebuild?
    I am new to these forums, and I do not see any database attachment to your message, or I would try your query myself.

    Jason Hinsperger
    SQL Anywhere Product Manager
    Sybase iAnywhere

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •