Skip to Content.
Sympa Menu

freetds - [freetds] Function sequence error from Linux => SQL Server 2000

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Charles Bearden" <Charles.F.Bearden AT uth.tmc.edu>
  • To: <FreeTDS AT lists.ibiblio.org>
  • Cc:
  • Subject: [freetds] Function sequence error from Linux => SQL Server 2000
  • Date: Wed, 28 Apr 2004 11:41:12 -0500

I'm new to the ODBC world. I am attempting to migrate a Python program
with mx.ODBC & WinXP MS SQL drivers to Linux. I would like to run them
on a RH9 machine under Python 2.3.3 and FreeTDS with the iODBC driver
manager. The target server is running SQL Server 2000. When I try to
load a chunk of Unicode into an ntext field in some records, the program
raises an exception due to a "function sequence error".

I have built and installed the following:

mxBase-2.0.5
mxCommercial-2.0.6
libiodbc-3.51.2
freetds-0.62.3

My etc/freetds.conf file correctly defines the server, and my .odbc.ini
file defines the databases I use on that server. I am using 'tds
version = 8.0', though changing to 7.0 makes no difference. The program
takes a stream of PubMed XML records, parses them with SAX, and for each
record loads some of the elements into a series of tables (both data &
junction tables), and takes the accumulated XML record and loads it into
another table. Certain records cause the script to throw an exception,
like so:

try: self._cur['xml'].execute('{call pm_CiteXmlChkIns(?,?)}', (pmid,
xml))
mxODBC.InternalError: ('S1010', 0, '[iODBC][Driver Manager]Function
sequence error', 2363)

where 'pmid' is the PubMed ID and 'xml' is the XML data of the record.
'pm_CiteXmlChkhIns' is a stored procedure that checks for the existence
of a row with the given PMID, and, if it exists, updates the XML column
with the new data, and if it doesn't, inserts a new row with the PMID
and XML data. This stored proc is a "glue" proc and calls other procs
that check, update, and insert.

The error is specific to particular records. In one file, it is the
11th record; in another, the 142nd (which also means that 141 records
are successfully loaded before the error occurs). There is no obvious
difference between the problem records and their predecessors that load
happily. The records are all valid XML, though since I'm just loading
them as chunks of Unicode, that shouldn't matter. I successfully loaded
the same records (almost 400,000 in all) to the same db under Windows
with mx.ODBC and WinXP's drivers and driver manager. The only
difference between the Windows & Linux versions of the program is that I
diddle the sys.path in Linux to find my copies of the libraries, and I
'import mx.ODBC.iODBC as mxodbc' instead of 'import mx.ODBC.Windows as
mxodbc'.

I not even sure what a function sequence error is, much less what could
cause it. Perhaps the driver doesn't like something about the way
pm_CiteXmlChkIns calls the other procedures? But it also calls this
procedure for the records that succeed.

I can provide a tdsdump.log but didn't want to send it to the list
unless someone wanted to see it.

Cluelessly yours,

Chuck Bearden
Systems Analyst III
School of Health Information Sciences
University of Texas at Houston
713.500.3954 (voice)
713.500.3907 (fax)
Charles.F.Bearden AT uth.tmc.edu




Archive powered by MHonArc 2.6.24.

Top of Page