SCO-Unix / Perl 5.8.8 / DBI 1.607 / FreeTDS 0.82.  Can not get Sybase 1.09  to compile nor unixODBC 2.2.14 to work

Posted on 2009-02-10
Last Modified: 2013-12-23
I have SCO Unix environment running Perl 5.8.8.  My project is to communicate with a SQL Server 2005 database on a remote server.  I have DBI 1.607 and FreeTDS 0.82 installed.  I can use "tsql" without any problems whatsoever.

I installed Sybase 1.09 so that I could embed a connection in a Perl script, but can not get it to compile correctly.  I googled the sitiuation and was able to find information relating to placing "#undef" statements in dbdimp.c for these constants: CS_VERSION_150, CS_VERSION_125, CS_VERSION_120, CS_DATE_TYPE, and CS_BIGINT_TYPE.  I also had to suppress an additional compiler error by formulating a reference to the "typedef perl_mutex" by including it in a header file (also referenced iin dbdimp.c).

At any rate, the "make test" doesn't work nor do any perl-based connections testing according to the prescribed methods.

I have also unixODBC 2.2.14 as a another possibility to solve this problem, but still no use.
The Sybase and FreeTDS tools are configured for the directory /usr/local/freetds.  My freetds.conf file looks like:


        host = DTRITDDX32CSAKA

        port = 1433           

        tds version = 8.0     

The output from "tsql -C":

Compile-time settings (established with the "configure" script) 

                            Version: freetds v0.82              

             freetds.conf directory: /usr/local/freetds/etc     

     MS db-lib source compatibility: no                         

        Sybase binary compatibility: no                         

                      Thread safety: yes                        

                      iconv library: yes                        

                        TDS version: 8.0                        

                              iODBC: no                         

                           unixodbc: yes                        


My odbc.ini entry looks like:


Description     = Northwind sample connection         

Driver          = /usr/local/freetds/lib/

Setup           = /usr/local/lib/           

Trace = No                                            

Server = DTRITDDX32CSAKA                              

Port   = 1433                                         

Database = Northwind                                  

UID = sa                                              

(Where the Server is a known node on our network.  This connection is valid.)

The output from odbcinst -j:

unixODBC 2.2.14                                    

DRIVERS............: /usr/local/etc/odbcinst.ini   

SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini       

FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources

USER DATA SOURCES..: /usr/acct/ces/.odbc.ini       

SQLULEN Size.......: 4                             

SQLLEN Size........: 4                             


Open in new window

Question by:steelspy
    LVL 61

    Assisted Solution

    Can I get 1 line of code and error it produces?

    Author Comment

    Isql output:
    <YT>: isql TDS_CES sa xyz                                              
    [ISQL]ERROR: Could not SQLConnect                                      

    <YT>: isql -v TDS_CES sa xyz                                          
    [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
    [ISQL]ERROR: Could not SQLConnect                                      

    Tried to use osql, but abends with this syntax error (running it from /bin/sh yields exact results):

    <YT>: osql -S DTRITDDX32CSAKA -U sa -P xyz                                
    /usr/local/freetds/bin/osql: syntax error at line 35: `ISQL=$' unexpected

    Still unsure of status regarding Sybase install, so I can't give you anything definitive.

    Accepted Solution

    I was able to wrestle with installing DBD-Sybase and finally got a successful test using a connection string embedded in a perl script.

    The jury is still out on trying to use unixODBC.  We were hoping to have either tool available for use, so that we could select the solution that provides the most integrity.  Therefore, if you have any unixODBC solutions and/or suggestions, we would greatly appreciate them.

    Thanks in advance.
    LVL 61

    Assisted Solution

    I guess server name in your ODBC.INI cannot be resolved on your UNIX system.
    Try pinging that name, and after use server's IP instead.

    Author Comment

    I am certain that unixODBC is just another way to use the same engines provided by FreeTDS and DBD-Sybase; therefore, I no longer require any help in pursuit of this endeavor.  As far as getting FreeTDS and DBD-Sybase working, I did all the research and testing myself.  I was right on the verge of getting a successful test when my supervisor required that I enter a plea for help on your web site.  My difficulties were never based on not being able to ping the server or not being able to use telnet-based testing in communication attempts.  Communication to the IP address was never an issue; if it were, I never would have been able to use "tsql" to test communicating to the database.  I will tell you that my evaluation copy of SQL Server 2000 had a bug that did not force communication at port 1433, but that too was resolved through research and installing a security patch from Microsoft before I put up this question on your web site.  Therefore, there was absolutely no assistance provided.

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
    If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now