Skip to Content
author's profile photo Former Member
Former Member

ASE ODBC driver related questions

Hi Friends,

I am using ODBC driver (the framework over ODBC API) to connect and read data from ASE database server on Windows.

I've few questions about ASE ODBC driver. Can you please guide me.

1) ASE has a DB option called "textsize" which sets the limit on amount data we can fetch in select statement.

This option can be set either in the DSN configuration (Advanced->Textsize text field) or by "set textsize <number>" for a session.

--- While scanning BLOBs (image data types), I want to increase this limit to 512MB in my application. But, I don't want to override the limit if user has Text Size field in the DSN configuration.

* how can we (programatically) find out the Text Size value set in the DSN configuration?

--- Is it possible using some ODBC function?

2) What is the maximum limit on the data returned by SQLGetData function call at a time?

--- Can we determine the size of the data stored in a column, especially the BLOB (or image) columns using ODBC API?

or do we need to run the query "select datalength(ColumnName) from tablename" ?

3) Which the most stable and reliable ODBC Driver Manager for Unix and Linux OSs? Is it unixODBC?

Many thanks in advance for your clarifications and time.

Best Regards

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 13, 2013 at 10:06 PM

    Hi Ganesh,

    For unixODBC, from the SDK 15.7 docs (Users Guide Adaptive Server Enterprise ODBC Driver by Sybase)

    http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc20116.1570/html/aseodbc/aseodbc5.htm

    For Linux - normally can use the unixODBC distributed with Red Hat and SuSE. I've using 2.2.11, 2.2.14 and also 2.3.1 and all seem to work fine. (I install multiple versions of unixODBC depending on what customers are using for specific cases).

    For UNIX you can use the Sybase iAnywhere ODBC Driver Manager included with the Driver installation or the recommened unixODBC version is 2.2.14 if you wish to install your own.

    Definitely check the note about the 4-byte vs. 8-byte SQLLEN. Since 15.7 ESD#4 we've included both the 4-byte and 8-byte SQLLEN ODBC Driver depending on your individual needs.

    On Red Hat 6 and later, the unixODBC Driver manager uses the 8-byte SQLLEN. This would be with 2.2.14 and higher.

    Hope this helps,

    Cheers,

    -Paul

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ganesh,

      I am not certain how use of Forward only will affect other drivers. It depends on what the application does. If it is just fetching the data and then using it separately from the ODBC Driver, that is the driver isn’t going to navigate around on the result set (I think you’d have to use scrollable cursor for this to happen anyway) if should be okay.

      You could also, inconveniently, create logic to set cursor type to fwd only for the ASE ODBC Driver.

      All you need to do is test some selects on other databases to see what happens. Typically, most drivers default cursor_type is forward_only, so they ought to work okay.

      Cheers,

      -Paul

  • author's profile photo Former Member
    Former Member
    Posted on May 10, 2013 at 03:03 PM

    Hi Ganesh,

    You can access the textsize for the session by checking the global variable @@textsize

    select @@textsize

    I don't think you can access it as a property (not sure you can do this anyway even if it were?) as it will just be set by the driver at connection time.

    You could look at the connection string but only with via a higher level api (OdbcConnectionStringBuilder class for .NET).

    SQLGetData can access the length if you set up a buffer to store it in, take a look at StrLen_or_IndPtr. You also have lob locators (others may be able to give you more on this) available from 15.7, take a look at:-

    http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc20116.1570/html/aseodbc/CIHGAFCE.htm

    Not sure I could recommend a driver manager, but if you are to use one on Linux\Unix, that's the only one I have used.

    I'm sure others might have some more useful info in that regard.

    HTH,

    Simon

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Yep, if this is the way you want to approach it you can execute all the commands within a single statement object. Provided the statements are separated with a space it'll take of it as a single batch of statements. Even that final select could go in the same string, the textsize change will be active at execution time of the select statement.

      Cheers,

      Simon

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.