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

Lowden, James K LowdenJK at bernstein.com
Wed Apr 28 15:12:22 EDT 2004

> From: Charles Bearden [mailto:Charles.F.Bearden at uth.tmc.edu]
> Sent: April 28, 2004 12:41 PM
> 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

Hi Charles, 

I'm unfamiliar with mxBase and know Python only from a distance.  I offer mere speculation.  

The "function sequence error" might refer to an ODBC error meaning "you called funtion B without calling function A first".  We have, in the past, found some cases in the FreeTDS ODBC driver whereby it expects an A-B-C calling sequence, but the ODBC spec says B is optional.  

Unfortunately, there's no neat trail of the calling sequence in the log.  If particular records cause the application to call FreeTDS differently for some reason, that might not be clear from the log.  

The error message emission logic should write a message to the TDSDUMP log in addition to returning an error to the caller.  If an error came back from the server (unlikely, based on your description) it would definitely be logged.  I'd look for something along those lines.  Since your log is probably huge, perhaps you post a relevant chunk or put it on a website somewhere?   

> 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).  

By "specific", do you mean specific to the data, or specific to the order?  IOW, if you move the 11th record to be first, does it still break?  (I bet: Yes.)  Is that record especially large or somehow different from the others?  Perhaps its an encoding issue.  Maybe there's a unicode value unsuitable to your client character set.  Or maybe this advice is worth what you're paying for it....

If nothing else, post the last 500 lines or so of the log, and we'll see what we see.  



The information contained in this transmission may contain privileged and confidential information and is intended only for the use of the person(s) named above. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender immediately by reply e-mail and destroy all copies of the original message. Please note that we do not accept account orders and/or instructions by e-mail, and therefore will not be responsible for carrying out such orders and/or instructions.
If you, as the intended recipient of this message, the purpose of which is to inform and update our clients, prospects and consultants of developments relating to our services and products, would not like to receive further e-mail correspondence from the sender, please "reply" to the sender indicating your wishes.  In the U.S.: 1345 Avenue of the Americas, New York, NY 10105.

More information about the FreeTDS mailing list