Sybase ASA 9.0.2 conflict

2005-07-14
2013-05-01
  • Denis Brajanovic

    I use this driver to access the ASA 9.0.1 database and it works great.  However, when I tried it with ASA 9.0.2 I ran into a bizarre problem.

    Here is a simple example that illustrates the problem:

    First I create a table as follows ...

    CREATE TABLE sometable (
       str_A CHAR(30),
       int_B INTEGER
    );

    INSERT INTO sometable (str_A, int_B) values ('First', 0);

    SELECT str_A as A,
           int_B as B
    FROM sometable;

    I get the following Results:
    A,         B
    'First',    0

    Then I run the above select statement using the Open DBExpress driver and get:

    Error returned from ODBC function SQLBindCol("B")
    ODBC Return Code: -1: SQL_ERROR
    ODBC SqlState:        HY090
    [Sybase][ODBC Driver]Invalid string or buffer length

    If instead I create a table with any of the following scenarios, the query returns the correct result:
    1) two integer columns
    2) two char(30) columns
    3) first column integer and the second column char(30)

    Any ideas as to what could be causing this problem would be appreciated.

     
    • Vadim V.Lopushanskiy

      Unfortunately for me is not present ASA. Try to specify in parameters of connection:
      SQLConnection1.Params.Values['RowsetSize'] := 1;

      It seems to me that the error occurs in the procedure: " TSqlCursorOdbc. BindResultSet; "
      Similar that in new ODBC SYBASE ASA version the error is accepted at processing buffer of multirows...

       
    • Denis Brajanovic

      Thanks for your reply, I will try your suggestion.  If you would like to test this yourself, you can download a free developer copy of ASA 9.0.2 Linux at:

      http://www.sybase.com/detail?id=1009174

       
    • Denis Brajanovic

      I tried adding RowsetSize = 1 to my entry in the dbxconnections file as well as in the OpenODBC entry in the dbxdrivers file but I'm still getting the same results.

       
      • Vadim V.Lopushanskiy

        To me it is necessary for more information.
        Include in "DbxOpenOdbc.pas" a mode: {$DEFINE _DEBUG _} also send me log of work.
        What version at you "Delphi/Kylix", "DbxOOdbc"?
        Try to add "DbxOpenOdbc.pas" in your file of the project.
        It will enable you to debug a code and to tell to me a place in "DbxOpenOdbc.pas" where this mistake occurs.
        Try to debug a method " TSqlCursorOdbc.BindResultSet". The type of fields (case fSqlType of) will be defined here.
        For a field "B" it there should be one of (SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT).
        Try to change places A and B:
        SELECT int_B as B, str_A as A FROM sometable;
        Try to use the previous version of odbc driver.

         
    • Denis Brajanovic

      The problem is in the ASA driver and Sybase is working to correct it.  Thanks for your help.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks