Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-06-2009, 02:02 PM   #1
LQ Newbie
Registered: Mar 2009
Location: Waltham, MA
Posts: 1

Rep: Reputation: 0
MSSQL/ODBC connection, query hangs

My goal/problem is as follows:

I need to be able to automate connecting to and pulling data from the EMC Visual SRM database in order to be able to automate reports. The data I need access to is in a MSSQL database on a Windows Server 2003. The script to do so runs on a Redhat 5.2 VM.

I have installed freetbs v0.82

Here is my configuration:

Description = TDS MSSQL (PUSDATIN)
Driver = TDS
ServerName = TDS
Database =
UID = username
Port = 1433

Description = v0.60 With Protocol v8.0
Driver = /usr/local/lib/
Setup = /usr/local/lib/
FileUsage = 1
UsageCount = 2

Description = TDS MSSQL (PUSDATIN)
Driver = TDS
Servername =
Database =
UID = username
Port = 1433

host =
port = 1433
tds version = 7.0

When I connect using isql and do a select * from a table, it returns only the first field from the first column.

I have a simple php script as a proof of concept to access the DB and do a query, but it hangs on the select:

$connect = odbc_connect("MSSQLServer", "srmreport", "srmreport") or die ("Couldn't connect");
print "connected\n";
odbc_exec($connect, "use Northwind");
print "exec use Northwind.\n";

$result = odbc_exec($connect, "SELECT CompanyName, ContactName " . "FROM Suppliers");
print "exec select\n";
while (odbc_fetch_row($result)) {
print(odbc_result($result, "CompanyName") .
' ' . odbc($result, "ContactName") . "\n");

this is what happens when the script is executed:

php odbctest.php
exec use Northwind.

and then it hangs

the last few lines of an strace of the execution show this:
poll([{fd=3, events=POLLOUT, revents=POLLOUT}], 1, -1) = 1
sendto(3, "\3\1\0\255\0\0\1\0\r\0s\0p\0_\0c\0u\0r\0s\0o\0r\0o\0p\0"..., 173, MSG_NOSIGNAL, NULL, 0) = 173
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, -1) = 1
recvfrom(3, "\4\1\0\321\0f\1\0", 8, MSG_NOSIGNAL, NULL, NULL) = 8
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, -1) = 1
recvfrom(3, "\201\3\0\0\0\10\0\347P\0\vC\0o\0m\0p\0a\0n\0y\0N\0a\0m\0e"..., 201, MSG_NOSIGNAL, NULL, NULL) = 201

a tcpdump between the VM and the Database server shows occasional
arp reply ...... (oui unknown)

I would be very grateful if someone can give any hints or clues as to why it may hang or suggest a method for finding the solution.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 11 + mysql 5.0.24 + OpenOffice 2.0.3 + ODBC connection bgeddy Slackware 6 01-29-2007 05:42 PM
How to make MSSQL server Connection ? girishk007 Programming 3 09-01-2006 12:35 AM
odbc connection on Debian Woody Skaan Linux - Newbie 2 05-31-2005 08:10 AM
ODBC connection to MySQL darius Linux - Software 2 09-29-2003 07:40 PM
odbc connection jstu Linux - General 1 11-12-2002 11:01 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration