none
Does the MS Sql odbc driver for linux work with the Perl DBI?

    Question

  • Hi,

    I'm trying to connect to MS SQL Server 2008 from a Linux box.  I wanted to know if the Microsoft SQL Server ODBC Driver 1.0 for Linux will work with the Perl DBI?  The overview of the driver says that it will work with C and C++ but I wanted to know if someone used it with Perl DBI.  Any instructions or links to documentation will be greatly appreciated.

    Kind regards,

    Dudenyc



    • Edited by Dudenyc Thursday, March 29, 2012 1:08 PM
    Wednesday, March 28, 2012 8:43 PM

Answers

  • Hi Dudenyc,

    The answer is no. By reference to this online article Chapter 12 - Developing: Applications - Migrating Perl, it reads:

    "A connectivity driver to the SQL Server database. This is provided by the port of FreeTDS on Interix and is downloadable from Interop Systems at http://www.interopsystems.com/tools/db.htm. FreeTDS provides two connectivity options for the Perl application to connect to the SQL Server database. One is a library called CTlib, which can be accessed through the DBD::Sybase module. The other is an odbc driver, which can be accessed though the DBD::ODBC module. "

    "If you use the ODBC driver, you will also need an ODBC driver manager. Two different ODBC driver managers iODBC and unixODBC are available for Windows Services for UNIX from http://www.interopsystems.com/tools/warehouse.htm."


    Best Regards,
    Peja

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


    • Edited by Peja Tao Friday, March 30, 2012 2:35 AM
    • Proposed as answer by Papy NormandModerator Saturday, March 31, 2012 6:11 PM
    • Marked as answer by Dudenyc Monday, April 02, 2012 8:25 PM
    Friday, March 30, 2012 2:35 AM

All replies

  • Hi Dudenyc,

    The answer is no. By reference to this online article Chapter 12 - Developing: Applications - Migrating Perl, it reads:

    "A connectivity driver to the SQL Server database. This is provided by the port of FreeTDS on Interix and is downloadable from Interop Systems at http://www.interopsystems.com/tools/db.htm. FreeTDS provides two connectivity options for the Perl application to connect to the SQL Server database. One is a library called CTlib, which can be accessed through the DBD::Sybase module. The other is an odbc driver, which can be accessed though the DBD::ODBC module. "

    "If you use the ODBC driver, you will also need an ODBC driver manager. Two different ODBC driver managers iODBC and unixODBC are available for Windows Services for UNIX from http://www.interopsystems.com/tools/warehouse.htm."


    Best Regards,
    Peja

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


    • Edited by Peja Tao Friday, March 30, 2012 2:35 AM
    • Proposed as answer by Papy NormandModerator Saturday, March 31, 2012 6:11 PM
    • Marked as answer by Dudenyc Monday, April 02, 2012 8:25 PM
    Friday, March 30, 2012 2:35 AM
  • Hi Peja,

    Thanks for the answer.  I've installed the DBD::Sybase module and FreeTDS driver and everything seems to work fine except the function "$sth->bind_param_inout".  I get a segmentation fault in my implementation.  I was wondering if anybody else came into this problem.  I have an excerpt of the code below.

    my $sth = $DB->{DBC}->prepare('EXECUTE OURDB.dbo.OURSTOREDPROC ?,? OUTPUT');
    $sth->bind_param(1, 'AM%');
    $sth->bind_param_inout(2, \$recCount, 4, DBI::SQL_INTEGER);
    $sth->execute();
    #Existence of bind_param_inout call causes segmentation fault on execute…

    while (my $rec = $sth->fetchrow_hashref() )
    {
       print $rec->{COMPANY_NAME} . "\n";
    }

    print $recCount;

    Thanks,


    dude


    • Edited by Dudenyc Monday, April 02, 2012 1:05 PM
    Friday, March 30, 2012 4:14 PM