Discussion:
[freetds] [unixODBC][Driver Manager]Function sequence error
Matevž Mrak
2014-07-11 06:31:07 UTC
Permalink
I am using mxODBC with unixODBC and FreeTDS driver 8.0 on OSX to connect
MSSQL Server 2008 R2 on other Windows machine in network.

I can connect with python and execute queries but when creating database
with script I am getting this error:

InterfaceError: ('HY010', 0, '[unixODBC][Driver Manager]Function
sequence error', 5258)
- File "/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py",
line 101, in execute[0m[31m15:28:59.787 0.0.0.0 {unknown} - Query to
execute: sp_pkeys 'Currencies' - File
"/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py",
line 102, in execute

at this qry:

Loading Image...

*freetds.conf:*

[DSNmy]
host = 10.13.7.248
port = 1433
tds version = 8.0
client charset = UTF-8

*odbc.ini:*

[ODBC Data Sources]
DSNmy = mysqlDriver
[DSNmy]
Driver = /usr/local/Cellar/freetds/lib/libtdsodbc.so
Server = 10.13.7.248Database = tst
UID = ana-rpc
PWD = s21s22
Port = 1433
TDS_Version = 8.0

*odbcinst.ini:*

[ODBC Drivers]
mysqlDriver = Installed
[mysqlDriver]
Driver = /usr/local/Cellar/freetds/lib/libtdsodbc.so
Setup = /usr/local/Cellar/freetds/lib/libtdsodbc.so
UsageCount = 1

*Specs:*

*MSSQL Server:* 2008 R2
*FreeTDS:* latest stable version
*OSX version:* 10.9.3
*UCS:* UCS2
*Eclipse:* Eclipse Standard/SDK - Kepler Service Release - Build id:
20140224-0627
*Python: 2.7.6* - 64bit
*mxBase version:*
egenix-mx-base-3.2.7-py2.7_ucs2-macosx-10.5-x86_64-prebuilt
*mxODBC version:* egenix-mxodbc-3.1.2.macosx-10.5-x86_64-py2.7_ucs2.prebuilt
*unixODBC:* 2.3.2 (this sample script works normally with no error, on my
case there is probably some issue with driver because database create is
working without problems on Windows machine)

from mx.ODBC.unixODBC import DriverConnect

db = DriverConnect('DSN=DSNmy;UID=ana-rpc;PWD=s21s22')print db
c = db.cursor()

c.execute('''CREATE TABLE article (
article_name varchar(20),
article_desc varchar(20));''')

db.commit()

Best regards, Matevz
--
Lep pozdrav,
Matev? Mrak
Matevž Mrak
2014-07-11 07:29:12 UTC
Permalink
I forgot to post my ODBC trace log: http://pastie.org/9377035

Best regards, Matevz
Post by Matevž Mrak
I am using mxODBC with unixODBC and FreeTDS driver 8.0 on OSX to connect
MSSQL Server 2008 R2 on other Windows machine in network.
I can connect with python and execute queries but when creating database
InterfaceError: ('HY010', 0, '[unixODBC][Driver Manager]Function sequence error', 5258)
- File "/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py", line 101, in execute[0m[31m15:28:59.787 0.0.0.0 {unknown} - Query to execute: sp_pkeys 'Currencies' - File "/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py", line 102, in execute
http://shrani.si/f/30/P8/3E6CUA0m/screen-shot-2014-07-10-a.png
*freetds.conf:*
[DSNmy]
host = 10.13.7.248
port = 1433
tds version = 8.0
client charset = UTF-8
*odbc.ini:*
[ODBC Data Sources]
DSNmy = mysqlDriver
[DSNmy]
Driver = /usr/local/Cellar/freetds/lib/libtdsodbc.so
Server = 10.13.7.248Database = tst
UID = ana-rpc
PWD = s21s22
Port = 1433
TDS_Version = 8.0
*odbcinst.ini:*
[ODBC Drivers]
mysqlDriver = Installed
[mysqlDriver]
Driver = /usr/local/Cellar/freetds/lib/libtdsodbc.so
Setup = /usr/local/Cellar/freetds/lib/libtdsodbc.so
UsageCount = 1
*Specs:*
*MSSQL Server:* 2008 R2
*FreeTDS:* latest stable version
*OSX version:* 10.9.3
*UCS:* UCS2
20140224-0627
*Python: 2.7.6* - 64bit
*mxBase version:*
egenix-mx-base-3.2.7-py2.7_ucs2-macosx-10.5-x86_64-prebuilt
*mxODBC version:*
egenix-mxodbc-3.1.2.macosx-10.5-x86_64-py2.7_ucs2.prebuilt
*unixODBC:* 2.3.2 (this sample script works normally with no error, on my
case there is probably some issue with driver because database create is
working without problems on Windows machine)
from mx.ODBC.unixODBC import DriverConnect
db = DriverConnect('DSN=DSNmy;UID=ana-rpc;PWD=s21s22')print db
c = db.cursor()
c.execute('''CREATE TABLE article (
article_name varchar(20),
article_desc varchar(20));''')
db.commit()
Best regards, Matevz
--
Lep pozdrav,
Matev? Mrak
--
Lep pozdrav,
Matev? Mrak
Frediano Ziglio
2014-07-12 07:12:07 UTC
Permalink
Cannot see any error in the trace

Frediano
Post by Matevž Mrak
I forgot to post my ODBC trace log: http://pastie.org/9377035
Best regards, Matevz
Post by Matevž Mrak
I am using mxODBC with unixODBC and FreeTDS driver 8.0 on OSX to connect
MSSQL Server 2008 R2 on other Windows machine in network.
I can connect with python and execute queries but when creating database
InterfaceError: ('HY010', 0, '[unixODBC][Driver Manager]Function
sequence error', 5258)
Post by Matevž Mrak
- File
"/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py",
line 101, in execute[0m[31m15:28:59.787 0.0.0.0 {unknown} - Query to
execute: sp_pkeys 'Currencies' - File
"/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py",
line 102, in execute
Post by Matevž Mrak
http://shrani.si/f/30/P8/3E6CUA0m/screen-shot-2014-07-10-a.png
*freetds.conf:*
[DSNmy]
host = 10.13.7.248
port = 1433
tds version = 8.0
client charset = UTF-8
*odbc.ini:*
[ODBC Data Sources]
DSNmy = mysqlDriver
[DSNmy]
Driver = /usr/local/Cellar/freetds/lib/libtdsodbc.so
Server = 10.13.7.248Database = tst
UID = ana-rpc
PWD = s21s22
Port = 1433
TDS_Version = 8.0
*odbcinst.ini:*
[ODBC Drivers]
mysqlDriver = Installed
[mysqlDriver]
Driver = /usr/local/Cellar/freetds/lib/libtdsodbc.so
Setup = /usr/local/Cellar/freetds/lib/libtdsodbc.so
UsageCount = 1
*Specs:*
*MSSQL Server:* 2008 R2
*FreeTDS:* latest stable version
*OSX version:* 10.9.3
*UCS:* UCS2
20140224-0627
*Python: 2.7.6* - 64bit
*mxBase version:*
egenix-mx-base-3.2.7-py2.7_ucs2-macosx-10.5-x86_64-prebuilt
*mxODBC version:*
egenix-mxodbc-3.1.2.macosx-10.5-x86_64-py2.7_ucs2.prebuilt
*unixODBC:* 2.3.2 (this sample script works normally with no error, on my
case there is probably some issue with driver because database create is
working without problems on Windows machine)
from mx.ODBC.unixODBC import DriverConnect
db = DriverConnect('DSN=DSNmy;UID=ana-rpc;PWD=s21s22')print db
c = db.cursor()
c.execute('''CREATE TABLE article (
article_name varchar(20),
article_desc varchar(20));''')
db.commit()
Best regards, Matevz
--
Lep pozdrav,
Matev? Mrak
--
Lep pozdrav,
Matev? Mrak
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
James K. Lowden
2014-07-12 14:10:21 UTC
Permalink
On Fri, 11 Jul 2014 08:31:07 +0200
Post by Matevž Mrak
InterfaceError: ('HY010', 0, '[unixODBC][Driver Manager]Function
sequence error', 5258)
- File
"/Users/matevzmrak/Desktop/praksa_fajli/projekt/ana/ana/srv/orm/driver.py",
Doesn't "function sequence error" mean you called the ODBC function in
an incorrect sequence, i.e., when you're not supposed to?

For example if you try to execute a query on an unopened connection,
you'll get an error that says the connection handle is invalid. In
other cases, though the handles are valid but the order of operation is
unsupported.

I would look at the ODBC trace of the calls made, and verify that it
makes sense.

HTH.
--jkl

Loading...