[Q] SQLSoup and pymssql from Linux

709 views
Skip to first unread message

Ladislav Lenart

unread,
Oct 5, 2012, 9:40:03 AM10/5/12
to sqlal...@googlegroups.com
Hello.

I try to access a Microsoft SQL database from Linux (Debian testing):

from sqlalchemy.ext.sqlsoup import SqlSoup

conn_string = 'mssql+pymssql://user:pass@freetds_name'
db = SqlSoup(conn_string)
v = db.some_table.first()
print v

freetds_name is the section name from /etc/freetds/freetds.conf

[freetds_name]
host = ...
port = 1433
tds version = 7.1
asa database = DB

The above script fails in pymssql on line 83, because line 81 sets vers to None:

def _get_server_version_info(self, connection):
vers = connection.scalar("select @@version")
m = re.match(
r"Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
if m:
return tuple(int(x) for x in m.group(1, 2, 3, 4))
else:
return None

But the following works in tsql:

1> select @@version
2> go

Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)
Apr 22 2011 19:23:43
Copyright (c) Microsoft Corporation
Workgroup Edition (64-bit) on Windows NT 6.1 <X64>
(Build 7601: Service Pack 1) (Hypervisor)

(1 row affected)


Any idea what is wrong?


Thank you,

Ladislav Lenart

Michael Bayer

unread,
Oct 5, 2012, 10:33:45 AM10/5/12
to sqlal...@googlegroups.com

On Oct 5, 2012, at 9:40 AM, Ladislav Lenart wrote:

> Hello.
>
> I try to access a Microsoft SQL database from Linux (Debian testing):
>
> from sqlalchemy.ext.sqlsoup import SqlSoup
>
> conn_string = 'mssql+pymssql://user:pass@freetds_name'
> db = SqlSoup(conn_string)
> v = db.some_table.first()
> print v
>
> freetds_name is the section name from /etc/freetds/freetds.conf
>
> [freetds_name]
> host = ...
> port = 1433
> tds version = 7.1
> asa database = DB
>
> The above script fails


I dont have easy access to pymssql here so can you fully define what "fails" means ? stack trace ?




> in pymssql on line 83, because line 81 sets vers to None:
>
> def _get_server_version_info(self, connection):
> vers = connection.scalar("select @@version")
> m = re.match(
> r"Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
> if m:
> return tuple(int(x) for x in m.group(1, 2, 3, 4))
> else:
> return None
>
> But the following works in tsql:
>
> 1> select @@version
> 2> go
>
> Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)
> Apr 22 2011 19:23:43
> Copyright (c) Microsoft Corporation
> Workgroup Edition (64-bit) on Windows NT 6.1 <X64>
> (Build 7601: Service Pack 1) (Hypervisor)
>
> (1 row affected)
>
>
> Any idea what is wrong?
>
>
> Thank you,
>
> Ladislav Lenart
>
> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To post to this group, send email to sqlal...@googlegroups.com.
> To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
>

lena...@volny.cz

unread,
Oct 5, 2012, 1:40:01 PM10/5/12
to sqlal...@googlegroups.com
Hello.

> I dont have easy access to pymssql here so can you fully define what "fails" means ? stack trace ?

I don't have access to my development environment during the weekend, so I cannot provide you with a stacktrace, but I try to better describe the issue:

def _get_server_version_info(self, connection)
vers = connection.scalar("select @@version")
m = re.match(r"Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
...

The above code snippet is from the file pymssql (around line 80). The variable vers is set to None and because of that the following regex fails with error "Expected string or buffer". The None is returned by the call to scalar(). The code snippet (from memory, I don't remember its exact location and form):

iter(resultproxy).next()

is called to get a next (first) result from the result proxy and it simply returns None as if there were no rows.

Ladislav Lenart

Michael Bayer

unread,
Oct 5, 2012, 6:47:06 PM10/5/12
to sqlal...@googlegroups.com
what I can do for the moment is this patch, if you want to try it:

diff -r 17cab4ad55d5 lib/sqlalchemy/dialects/mssql/pymssql.py
--- a/lib/sqlalchemy/dialects/mssql/pymssql.py Thu Oct 04 18:26:55 2012 -0400
+++ b/lib/sqlalchemy/dialects/mssql/pymssql.py Fri Oct 05 18:46:01 2012 -0400
@@ -80,7 +80,7 @@
def _get_server_version_info(self, connection):
vers = connection.scalar("select @@version")
m = re.match(
- r"Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
+ r"\s*Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
if m:
return tuple(int(x) for x in m.group(1, 2, 3, 4))
else:



otherwise, I'd consider using pyodbc for which the dialect and DBAPI are production quality. I use pyodbc with FreeTDS on unix platforms in production.

Ladislav Lenart

unread,
Oct 8, 2012, 5:11:40 AM10/8/12
to sqlal...@googlegroups.com, Michael Bayer
Hello.

> otherwise, I'd consider using pyodbc for which the dialect and DBAPI are
production quality. I use pyodbc with FreeTDS on unix platforms in production.

Ok, I can use pyodbc if it is the preferred choice. However I cannot make it
work either. I suspect that I supply bad connection string but am a little lost
in the docs...

The code:

from sqlalchemy.ext.sqlsoup import SqlSoup

if __name__ == '__main__':
conn_string = 'mssql+pyodbc://username:pass\@wo...@10.230.128.140:1433/ZFP_CRM'
db = SqlSoup(conn_string)
x = db.zfp_mlm_spol.first()


fails (see the traceback below). Note the password contains the character '@'.
The preceeding '\' is my attempt to escape it.

What connection string should I use to connect to MSSQL via pyodbc using freetds?

Thank you,

Ladislav Lenart


THE TRACEBACK:

Traceback (most recent call last):
File
"/home/lada/.eclipse/org.eclipse.platform_3.8_155965261/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydevd.py",
line 1392, in <module>
debugger.run(setup['file'], None, None)
File
"/home/lada/.eclipse/org.eclipse.platform_3.8_155965261/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydevd.py",
line 1085, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "/home/lada/mine/devel/python/ZFP/zfp_connect.py", line 11, in <module>
x = db.zfp_mlm_spol.first()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 807,
in __getattr__
return self.entity(attr)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 804,
in entity
return self.map_to(attr, tablename=attr, schema=schema)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 684,
in map_to
schema=schema or self.schema)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 318, in __new__
table._init(name, metadata, *args, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 381, in _init
self._autoload(metadata, autoload_with, include_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 397, in
_autoload
self, include_columns, exclude_columns
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2424,
in run_callable
conn = self.contextual_connect()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2490,
in contextual_connect
self.pool.connect(),
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 224, in connect
return _ConnectionFairy(self).checkout()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 387, in __init__
rec = self._connection_record = pool._do_get()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 741, in _do_get
con = self._create_connection()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 188, in
_create_connection
return _ConnectionRecord(self)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 270, in __init__
self.connection = self.__connect()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 330, in __connect
connection = self.__pool._creator()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line
80, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line
281, in connect
return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.DBAPIError: (Error) ('IM002', '[IM002] [unixODBC][Driver
Manager]Data source name not found, and no default driver specified (0)
(SQLDriverConnectW)') None None

Ladislav Lenart

unread,
Oct 8, 2012, 9:02:19 AM10/8/12
to sqlal...@googlegroups.com, Michael Bayer
Hello again.

It turned out that I was missing some ODBC-related packages and also needed to
configure freetds to work with unixodbc. I managed to finally do it, though it
was by no means easy for me (trial and error of several tutorials).

The following code works now:

import pyodbc
cnxn =
pyodbc.connect('DRIVER={FreeTDS};SERVER=1.2.3.4;PORT=1433;DATABASE=ZFP_CRM;UID=username;PWD=pass@cword;TDS_VERSION=8.0')
cursor = cnxn.cursor()
cursor.execute("select * from mlm_spol")
row = cursor.fetchone()
print row


However SqlSoup does not work. The code:

import pyodbc
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup
def connect():
return
pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0;')
engine = create_engine('mssql+pyodbc://', creator=connect)
db = SqlSoup(engine)
row = db.mlm_spol.first()
print row


fails with:

Traceback (most recent call last):
File "/home/lada/mine/devel/python/ZFP/zfp_connect.py", line 16, in <module>
x = db.mlm_spol.first()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 807,
in __getattr__
return self.entity(attr)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 804,
in entity
return self.map_to(attr, tablename=attr, schema=schema)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 684,
in map_to
schema=schema or self.schema)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 318, in __new__
table._init(name, metadata, *args, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 381, in _init
self._autoload(metadata, autoload_with, include_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 397, in
_autoload
self, include_columns, exclude_columns
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2426,
in run_callable
return conn.run_callable(callable_, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1969,
in run_callable
return callable_(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line
260, in reflecttable
return insp.reflecttable(table, include_columns, exclude_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line
412, in reflecttable
raise exc.NoSuchTableError(table.name)
sqlalchemy.exc.NoSuchTableError: mlm_spol


Any ideas?


Thanks,

Ladislav Lenart

Ladislav Lenart

unread,
Oct 8, 2012, 9:22:08 AM10/8/12
to sqlal...@googlegroups.com, Michael Bayer
Hello.

UPDATE: The raw SqlSoup.execute() works:

import pyodbc
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup

def connect():
return
pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0;')
engine = create_engine('mssql+pyodbc://', creator=connect)
db = SqlSoup(engine)
x = db.execute("select * from mlm_spol").fetchone()
print x


Any ideas what I have to do to make SqlSoup's ORM work? I am out of ideas.

Ladislav Lenart

Michael Bayer

unread,
Oct 8, 2012, 10:20:56 AM10/8/12
to sqlal...@googlegroups.com
"no such table" usually means you're not connected to the database that you think you are.

I'd strongly suggest configuring an ODBC datasource within FreeTDS, and using standard connection techniques. Hostname, port, tds version go into freetds.conf, and database names go into odbc.ini.

In freetds conf for example I have:

[ms_2005]
host = 172.16.248.128
port = 1213
tds version = 8.0
client charset = UTF8
text size = 50000000


and on my mac in /Library/ODBC/odbc.ini I have:

[ODBC Data Sources]
ms_2005 = test

[ms_2005]
Driver = /usr/local/lib/libtdsodbc.so
Description = test
Trace = No
Servername = ms_2005


I then connect with SQLAlchemy as:

create_engine("mssql://scott:tiger@ms_2005")

see http://freetds.schemamania.org/userguide/prepodbc.htm for freetds' docs on all this.

Ladislav Lenart

unread,
Oct 8, 2012, 11:10:29 AM10/8/12
to sqlal...@googlegroups.com, Michael Bayer
Ok, I will give it yet another try, but please note that the following works:

import pyodbc
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup

def connect():
return
pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0;')
engine = create_engine('mssql+pyodbc://', creator=connect)
db = SqlSoup(engine)
x = db.execute("select * from mlm_spol").fetchone()
print x


i.e. raw SqlSoup.execute() sees the table and returns a valid result.


I regard this as a proof that the connection was established successfully and
the problem lies elsewhere. Am I wrong?


Ladislav Lenart

Michael Bayer

unread,
Oct 8, 2012, 11:18:56 AM10/8/12
to Ladislav Lenart, sqlal...@googlegroups.com

On Oct 8, 2012, at 11:10 AM, Ladislav Lenart wrote:

> Ok, I will give it yet another try, but please note that the following works:
>
> import pyodbc
> from sqlalchemy.engine import create_engine
> from sqlalchemy.ext.sqlsoup import SqlSoup
>
> def connect():
> return
> pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0;')
> engine = create_engine('mssql+pyodbc://', creator=connect)
> db = SqlSoup(engine)
> x = db.execute("select * from mlm_spol").fetchone()
> print x
>
>
> i.e. raw SqlSoup.execute() sees the table and returns a valid result.
>
>
> I regard this as a proof that the connection was established successfully and
> the problem lies elsewhere. Am I wrong?


perhaps. Maybe the connection doesn't have correct access to the information schema tables, as SQLSoup relies upon table reflection. you'd need to run with echo='debug' on your engine to see exactly what queries are being emitted and the rows being returned, and determine why an information schema row for "mlm_spol" isn't being returned.


Ladislav Lenart

unread,
Oct 8, 2012, 11:43:00 AM10/8/12
to sqlal...@googlegroups.com, Michael Bayer
Hello.


> perhaps. Maybe the connection doesn't have correct access to the information
schema tables, as SQLSoup relies upon table reflection. you'd need to run with
echo='debug' on your engine to see exactly what queries are being emitted and
the rows being returned, and determine why an information schema row for
"mlm_spol" isn't being returned.

I did it and it seems that there is a str/unicode problem when dealing with the
information shema (see below, it's rather long).

I tried it with charset=UTF8 to pyodbc.connect string. I also tried various
combinations of create_engine options supports_unicode_binds and convert_unicode
but none of them worked.

Ladislav Lenart


CODE:

import pyodbc
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup

def connect():
return
pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0;')
engine = create_engine('mssql+pyodbc://', creator=connect, echo='debug')
db = SqlSoup(engine)
x = db.execute("select * from mlm_spol").fetchone()
print x


ITS DEBUG OUTPUT:

pydev debugger: starting
2012-10-08 17:19:53,239 INFO sqlalchemy.engine.base.Engine SELECT user_name() as
user_name;
2012-10-08 17:19:53,240 INFO sqlalchemy.engine.base.Engine ()
2012-10-08 17:19:53,246 DEBUG sqlalchemy.engine.base.Engine Col ('user_name',)
2012-10-08 17:19:53,247 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U00660065\U00610072\U00740063\U006c0061', )
2012-10-08 17:19:53,253 INFO sqlalchemy.engine.base.Engine
SELECT default_schema_name FROM
sys.database_principals
WHERE name = ?
AND type = 'S'

2012-10-08 17:19:53,253 INFO sqlalchemy.engine.base.Engine
(u'\U00660065\U00610072\U00740063\U006c0061',)
2012-10-08 17:19:53,259 DEBUG sqlalchemy.engine.base.Engine Col
('default_schema_name',)
2012-10-08 17:19:53,286 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2012-10-08 17:19:53,288 INFO sqlalchemy.engine.base.Engine select * from mlm_spol
2012-10-08 17:19:53,289 INFO sqlalchemy.engine.base.Engine ()
2012-10-08 17:19:53,304 DEBUG sqlalchemy.engine.base.Engine Col ('id_mlm_spol',
'id_mlm_spol_master', 'id_mlm_spol_ridici', 'id_mlm_spol_reditel',
'id_mlm_spol_predstav', 'id_mlm_spol_ppz', 'id_mlm_spol_psedm',
'id_mlm_spol_gar_cz', 'id_mlm_spol_gar_sk', 'id_mlm_spol_reditel_cz',
'id_mlm_spol_reditel_sk', 'id_mlm_spol_predstav_cz', 'id_mlm_spol_predstav_sk',
'id_mlm_spol_ridici_cz', 'id_mlm_spol_ridici_sk', 'id_mlm_spol_psedm_cz',
'id_mlm_spol_psedm_sk', 'id_mlm_firma_subjekt', 'pocet_primi', 'pocet_celkem',
'typ_spol', 'info', 'info_extended', 'os_cislo', 'os_cislo_sk', 'alt_cislo_1',
'alt_cislo_2', 'alt_cislo_3', 'pozice', 'dosahnuti_pozice', 'stav',
'dosahnuti_stavu', 'datum_dosahnuti_stavu', 'smlouva', 'prvni_aplikace_smlouvy',
'vznik_vykonu', 'rfp', 'body_vlastni', 'body_vlastni_alt',
'body_vlastni_alt_trans', 'body_skup', 'body_skup_alt', 'body_skup_alt_trans',
'body_top_struktury', 'kod_banky', 'cislo_uctu', 'spec_symbol', 'eu_banka',
'rod_cis', 'ico', 'pozice_puv', 'postup', 'os_cislo_reditel', 'os_cislo_ridici',
'os_cislo_sponzor', 'os_cislo_predstav', 'typoval', 'zmena', 'poznamka',
'pokus', 'os_cislo_sponzor_new', 'body_celkem', 'blokovany_postup',
'evidencni_cislo', 'body_celkem_200501', 'cislo_slev_karty', 'reg_cislo_mf',
'reg_cislo_uft', 'datum_prid_slev_karty', 'obdobi_prid_slev_karty',
'id_mlm_spol_gar_orig_cz', 'id_mlm_spol_gar_orig_sk', 'zmena_gar_cz',
'zmena_gar_sk', 'duvod_zmeny_gar_cz', 'duvod_zmeny_gar_sk', 'datum_last_cz',
'datum_last_sk', 'id_mlm_smlouva_last_cz', 'id_mlm_smlouva_last_sk',
'id_mlm_strukt_man_cz', 'id_mlm_strukt_man_sk', 'id_mlm_spol_ros_cz',
'id_mlm_spol_ros_sk', 'tisk_ps_1', 'tisk_ps_2', 'tisk_ps_3', 'tisk_ps_4',
'tisk_ps_1_rucni', 'tisk_ps_3_rucni', 'tisk_ps_5', 'tisk_ps_5_rucni',
'id_mlm_spol_psedm_akt_cz', 'id_mlm_spol_psedm_akt_sk', 'id_mlm_spol_hrk_cz',
'id_mlm_spol_hrk_sk', 'provizni_stav', 'menit_automaticky_pstav',
'zda_uplatnovat_kredit', 'perioda_dosahnuti_pozice', 'firma')
2012-10-08 17:19:53,306 DEBUG sqlalchemy.engine.base.Engine Row (277581, 268893,
37494, 37494, 20198, None, 37494, 119835, 18954, 37494, 18954, 20198, 18954,
37494, 18996, 37494, 18996, None, 0, 0, 'O', None, None, '414712', None, None,
None, None, '1', None, 1, '201208', datetime.datetime(2012, 8, 25, 0, 0), None,
None, None, None, Decimal('0.000000'), Decimal('0.000000'), Decimal('0.000000'),
Decimal('0.000000'), Decimal('0.000000'), Decimal('0.000000'),
Decimal('0.000000'), None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, Decimal('0.000000'), None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, 37494, 18954, 18996, 19009, 'A', None, None, None, 'N', None, None,
None, 37494, 20198, 20198, 18954, False, True, True, 0, None)


CODE:

import pyodbc
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup

def connect():
return
pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0;')
engine = create_engine('mssql+pyodbc://', creator=connect, echo='debug')
db = SqlSoup(engine)
x = db.mlm_spol.fetchone()
print x


ITS DEBUG OUTPUT:

pydev debugger: starting
2012-10-08 17:33:07,175 INFO sqlalchemy.engine.base.Engine SELECT user_name() as
user_name;
2012-10-08 17:33:07,176 INFO sqlalchemy.engine.base.Engine ()
2012-10-08 17:33:07,181 DEBUG sqlalchemy.engine.base.Engine Col ('user_name',)
2012-10-08 17:33:07,182 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U00660065\U00610072\U00740063\U006c0061', )
2012-10-08 17:33:07,188 INFO sqlalchemy.engine.base.Engine
SELECT default_schema_name FROM
sys.database_principals
WHERE name = ?
AND type = 'S'

2012-10-08 17:33:07,189 INFO sqlalchemy.engine.base.Engine
(u'\U00660065\U00610072\U00740063\U006c0061',)
2012-10-08 17:33:07,194 DEBUG sqlalchemy.engine.base.Engine Col
('default_schema_name',)
2012-10-08 17:33:07,243 INFO sqlalchemy.engine.base.Engine SELECT
[COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME], [COLUMNS_1].[COLUMN_NAME],
[COLUMNS_1].[IS_NULLABLE], [COLUMNS_1].[DATA_TYPE],
[COLUMNS_1].[ORDINAL_POSITION], [COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH],
[COLUMNS_1].[NUMERIC_PRECISION], [COLUMNS_1].[NUMERIC_SCALE],
[COLUMNS_1].[COLUMN_DEFAULT], [COLUMNS_1].[COLLATION_NAME]
FROM [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1]
WHERE [COLUMNS_1].[TABLE_NAME] = ? AND [COLUMNS_1].[TABLE_SCHEMA] = ? ORDER BY
[COLUMNS_1].[ORDINAL_POSITION]
2012-10-08 17:33:07,244 INFO sqlalchemy.engine.base.Engine (u'mlm_spol', u'dbo')
2012-10-08 17:33:07,259 DEBUG sqlalchemy.engine.base.Engine Col ('TABLE_SCHEMA',
'TABLE_NAME', 'COLUMN_NAME', 'IS_NULLABLE', 'DATA_TYPE', 'ORDINAL_POSITION',
'CHARACTER_MAXIMUM_LENGTH', 'NUMERIC_PRECISION', 'NUMERIC_SCALE',
'COLUMN_DEFAULT', 'COLLATION_NAME')
2012-10-08 17:33:07,264 INFO sqlalchemy.engine.base.Engine sp_columns
@table_name = 'mlm_spol', @table_owner = 'dbo'
2012-10-08 17:33:07,265 INFO sqlalchemy.engine.base.Engine ()
2012-10-08 17:33:07,282 DEBUG sqlalchemy.engine.base.Engine Col
('TABLE_QUALIFIER', 'TABLE_OWNER', 'TABLE_NAME', 'COLUMN_NAME', 'DATA_TYPE',
'TYPE_NAME', 'PRECISION', 'LENGTH', 'SCALE', 'RADIX', 'NULLABLE', 'REMARKS',
'COLUMN_DEF', 'SQL_DATA_TYPE', 'SQL_DATETIME_SUB', 'CHAR_OCTET_LENGTH',
'ORDINAL_POSITION', 'IS_NULLABLE', 'SS_DATA_TYPE')
2012-10-08 17:33:07,283 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070', 4,
u'\U006e0069\U00200074\U00640069\U006e0065\U00690074\U00790074', 10, 4, 0, 10,
0, None, None, 4, None, None, 1, 'NO', 56)
2012-10-08 17:33:07,285 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U0061006d\U00740073\U00720065',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 2, 'YES', 38)
2012-10-08 17:33:07,286 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00690072\U00690064\U00690063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 3, 'YES', 38)
2012-10-08 17:33:07,287 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00650072\U00690064\U00650074',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 4, 'YES', 38)
2012-10-08 17:33:07,288 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00720070\U00640065\U00740073\U00760061',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 5, 'YES', 38)
2012-10-08 17:33:07,289 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00700070', 4,
u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 6, 'YES', 38)
2012-10-08 17:33:07,290 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00730070\U00640065',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 7, 'YES', 38)
2012-10-08 17:33:07,291 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00610067\U005f0072\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 8, 'YES', 38)
2012-10-08 17:33:07,292 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00610067\U005f0072\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 9, 'YES', 38)
2012-10-08 17:33:07,293 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00650072\U00690064\U00650074\U005f006c\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 10, 'YES', 38)
2012-10-08 17:33:07,294 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00650072\U00690064\U00650074\U005f006c\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 11, 'YES', 38)
2012-10-08 17:33:07,295 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00720070\U00640065\U00740073\U00760061\U0063005f',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 12, 'YES', 38)
2012-10-08 17:33:07,296 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00720070\U00640065\U00740073\U00760061\U0073005f',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 13, 'YES', 38)
2012-10-08 17:33:07,296 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00690072\U00690064\U00690063\U0063005f',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 14, 'YES', 38)
2012-10-08 17:33:07,297 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00690072\U00690064\U00690063\U0073005f',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 15, 'YES', 38)
2012-10-08 17:33:07,298 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00730070\U00640065\U005f006d\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 16, 'YES', 38)
2012-10-08 17:33:07,299 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00730070\U00640065\U005f006d\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 17, 'YES', 38)
2012-10-08 17:33:07,300 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0066005f\U00720069\U0061006d\U0073005f\U00620075\U0065006a\U0074006b',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 18, 'YES', 38)
2012-10-08 17:33:07,301 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0070\U00650063\U005f0074\U00720070\U006d0069', 4, u'\U006e0069', 10, 4,
0, 10, 1, None, None, 4, None, None, 19, 'YES', 38)
2012-10-08 17:33:07,302 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0070\U00650063\U005f0074\U00650063\U006b006c\U006d0065', 4,
u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 20, 'YES', 38)
2012-10-08 17:33:07,303 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00790074\U005f0070\U00700073\U006c006f', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 0, None, None, 12, None, 1,
21, 'NO', 39)
2012-10-08 17:33:07,305 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006e0069\U006f0066', 12,
u'\U00610076\U00630072\U00610068', 250, 250, None, None, 1, None, None, 12,
None, 250, 22, 'YES', 39)
2012-10-08 17:33:07,306 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006e0069\U006f0066\U0065005f\U00740078\U006e0065\U00650064', 12,
u'\U00610076\U00630072\U00610068', 250, 250, None, None, 1, None, None, 12,
None, 250, 23, 'YES', 39)
2012-10-08 17:33:07,307 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 24, 'YES', 39)
2012-10-08 17:33:07,309 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c\U0073005f', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 25, 'YES', 39)
2012-10-08 17:33:07,310 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006c0061\U005f0074\U00690063\U006c0073\U005f006f', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 26, 'YES', 39)
2012-10-08 17:33:07,311 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006c0061\U005f0074\U00690063\U006c0073\U005f006f', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 27, 'YES', 39)
2012-10-08 17:33:07,313 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006c0061\U005f0074\U00690063\U006c0073\U005f006f', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 28, 'YES', 39)
2012-10-08 17:33:07,314 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006f0070\U0069007a\U00650063',
12, u'\U00610076\U00630072\U00610068', 3, 3, None, None, 1, None, None, 12,
None, 3, 29, 'YES', 39)
2012-10-08 17:33:07,315 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0064\U00610073\U006e0068\U00740075\U005f0069\U006f0070\U0069007a\U00650063',
12, u'\U00610076\U00630072\U00610068', 6, 6, None, None, 1, None, None, 12,
None, 6, 30, 'YES', 39)
2012-10-08 17:33:07,316 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U00740073\U00760061', 5,
u'\U006d0073\U006c0061\U0069006c\U0074006e', 5, 2, 0, 10, 1, None, None, 5,
None, None, 31, 'YES', 38)
2012-10-08 17:33:07,317 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0064\U00610073\U006e0068\U00740075\U005f0069\U00740073\U00760061', 12,
u'\U00610076\U00630072\U00610068', 6, 6, None, None, 1, None, None, 12, None, 6,
32, 'YES', 39)
2012-10-08 17:33:07,319 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00610064\U00750074\U005f006d\U006f0064\U00610073\U006e0068\U00740075\U005f0069\U00740073\U00760061',
11, u'\U00610064\U00650074\U00690074\U0065006d', 23, 16, 3, None, 1, None, None,
9, 3, None, 33, 'YES', 111)
2012-10-08 17:33:07,320 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006d0073\U006f006c\U00760075',
5, u'\U006d0073\U006c0061\U0069006c\U0074006e', 5, 2, 0, 10, 1, None, None, 5,
None, None, 34, 'YES', 38)
2012-10-08 17:33:07,321 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00720070\U006e0076\U005f0069\U00700061\U0069006c\U0061006b\U00650063\U0073005f\U006c006d\U0075006f\U00790076',
12, u'\U00610076\U00630072\U00610068', 6, 6, None, None, 1, None, None, 12,
None, 6, 35, 'YES', 39)
2012-10-08 17:33:07,322 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U007a0076\U0069006e\U005f006b\U00790076\U006f006b\U0075006e', 12,
u'\U00610076\U00630072\U00610068', 6, 6, None, None, 1, None, None, 12, None, 6,
36, 'YES', 39)
2012-10-08 17:33:07,324 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U00660072', 12,
u'\U00610076\U00630072\U00610068', 6, 6, None, None, 1, None, None, 12, None, 6,
37, 'YES', 39)
2012-10-08 17:33:07,325 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0076005f\U0061006c\U00740073\U0069006e', 3,
u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None, None,
38, 'NO', 55)
2012-10-08 17:33:07,326 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0076005f\U0061006c\U00740073\U0069006e\U0061005f\U0074006c',
3, u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None,
None, 39, 'NO', 55)
2012-10-08 17:33:07,326 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0076005f\U0061006c\U00740073\U0069006e\U0061005f\U0074006c\U0074005f\U00610072\U0073006e',
3, u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None,
None, 40, 'NO', 55)
2012-10-08 17:33:07,327 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0073005f\U0075006b', 3,
u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None, None,
41, 'NO', 55)
2012-10-08 17:33:07,328 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0073005f\U0075006b\U005f0070\U006c0061', 3,
u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None, None,
42, 'NO', 55)
2012-10-08 17:33:07,329 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0073005f\U0075006b\U005f0070\U006c0061\U005f0074\U00720074\U006e0061',
3, u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None,
None, 43, 'NO', 55)
2012-10-08 17:33:07,330 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0074005f\U0070006f\U0073005f\U00720074\U006b0075\U00750074\U00790072',
3, u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 0, None, None, 3, None,
None, 44, 'NO', 55)
2012-10-08 17:33:07,331 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f006b\U005f0064\U00610062\U006b006e', 12,
u'\U00610076\U00630072\U00610068', 4, 4, None, None, 1, None, None, 12, None, 4,
45, 'YES', 39)
2012-10-08 17:33:07,332 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690063\U006c0073\U005f006f\U00630075\U00750074', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 46, 'YES', 39)
2012-10-08 17:33:07,333 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00700073\U00630065\U0073005f\U006d0079\U006f0062', 12,
u'\U00610076\U00630072\U00610068', 50, 50, None, None, 1, None, None, 12, None,
50, 47, 'YES', 39)
2012-10-08 17:33:07,334 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00750065\U0062005f\U006e0061\U0061006b', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 48, 'YES', 39)
2012-10-08 17:33:07,335 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006f0072\U005f0064\U00690063',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 49, 'YES', 39)
2012-10-08 17:33:07,336 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U00630069', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 50, 'YES', 39)
2012-10-08 17:33:07,337 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0070\U0069007a\U00650063\U0070005f\U00760075', 12,
u'\U00610076\U00630072\U00610068', 3, 3, None, None, 1, None, None, 12, None, 3,
51, 'YES', 39)
2012-10-08 17:33:07,338 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006f0070\U00740073\U00700075',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 52, 'YES', 39)
2012-10-08 17:33:07,339 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c\U0072005f\U00640065\U00740069\U006c0065',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 53, 'YES', 39)
2012-10-08 17:33:07,339 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c\U0072005f\U00640069\U00630069', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 54, 'YES', 39)
2012-10-08 17:33:07,340 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c\U0073005f\U006f0070\U007a006e\U0072006f',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 55, 'YES', 39)
2012-10-08 17:33:07,341 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c\U0070005f\U00650072\U00730064\U00610074',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 56, 'YES', 39)
2012-10-08 17:33:07,342 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U00790074\U006f0070\U00610076',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 57, 'YES', 39)
2012-10-08 17:33:07,343 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006d007a\U006e0065', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 58, 'YES', 39)
2012-10-08 17:33:07,344 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0070\U006e007a\U006d0061\U0061006b', 12,
u'\U00610076\U00630072\U00610068', 2000, 2000, None, None, 1, None, None, 12,
None, 2000, 59, 'YES', 39)
2012-10-08 17:33:07,345 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U006f0070\U0075006b', 12,
u'\U00610076\U00630072\U00610068', 50, 50, None, None, 1, None, None, 12, None,
50, 60, 'YES', 39)
2012-10-08 17:33:07,346 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0073006f\U0063005f\U00730069\U006f006c\U0073005f\U006f0070\U007a006e\U0072006f\U006e005f\U00770065',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 61, 'YES', 39)
2012-10-08 17:33:07,347 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0063005f\U006c0065\U0065006b', 3,
u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 1, None, None, 3, None, None,
62, 'YES', 106)
2012-10-08 17:33:07,348 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006c0062\U006b006f\U0076006f\U006e0061\U005f0079\U006f0070\U00740073\U00700075',
5, u'\U006d0073\U006c0061\U0069006c\U0074006e', 5, 2, 0, 10, 1, None, None, 5,
None, None, 63, 'YES', 38)
2012-10-08 17:33:07,349 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00760065\U00640069\U006e0065\U006e0063\U005f0069\U00690063\U006c0073', 12,
u'\U00610076\U00630072\U00610068', 10, 10, None, None, 1, None, None, 12, None,
10, 64, 'YES', 39)
2012-10-08 17:33:07,350 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006f0062\U00790064\U0063005f\U006c0065\U0065006b\U005f006d\U00300032\U00350030\U00310030',
3, u'\U00650064\U00690063\U0061006d', 18, 20, 6, 10, 1, None, None, 3, None,
None, 65, 'YES', 106)
2012-10-08 17:33:07,351 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690063\U006c0073\U005f006f\U006c0073\U00760065\U006b005f\U00720061\U00790074',
12, u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12,
None, 20, 66, 'YES', 39)
2012-10-08 17:33:07,352 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00650072\U005f0067\U00690063\U006c0073\U005f006f\U0066006d', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 67, 'YES', 39)
2012-10-08 17:33:07,353 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00650072\U005f0067\U00690063\U006c0073\U005f006f\U00660075', 12,
u'\U00610076\U00630072\U00610068', 20, 20, None, None, 1, None, None, 12, None,
20, 68, 'YES', 39)
2012-10-08 17:33:07,353 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00610064\U00750074\U005f006d\U00720070\U00640069\U0073005f\U0065006c\U005f0076\U0061006b\U00740072',
11, u'\U00610064\U00650074\U00690074\U0065006d', 23, 16, 3, None, 1, None, None,
9, 3, None, 69, 'YES', 111)
2012-10-08 17:33:07,354 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0062006f\U006f0064\U00690062\U0070005f\U00690072\U005f0064\U006c0073\U00760065\U006b005f\U00720061\U00790074',
12, u'\U00610076\U00630072\U00610068', 6, 6, None, None, 1, None, None, 12,
None, 6, 70, 'YES', 39)
2012-10-08 17:33:07,355 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00610067\U005f0072\U0072006f\U00670069\U0063005f',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 71, 'YES', 38)
2012-10-08 17:33:07,356 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00610067\U005f0072\U0072006f\U00670069\U0073005f',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 72, 'YES', 38)
2012-10-08 17:33:07,357 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006d007a\U006e0065\U005f0061\U00610067\U005f0072\U007a0063', 11,
u'\U00610064\U00650074\U00690074\U0065006d', 23, 16, 3, None, 1, None, None, 9,
3, None, 73, 'YES', 111)
2012-10-08 17:33:07,358 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U006d007a\U006e0065\U005f0061\U00610067\U005f0072\U006b0073', 11,
u'\U00610064\U00650074\U00690074\U0065006d', 23, 16, 3, None, 1, None, None, 9,
3, None, 74, 'YES', 111)
2012-10-08 17:33:07,359 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00750064\U006f0076\U005f0064\U006d007a\U006e0065\U005f0079\U00610067\U005f0072\U007a0063',
5, u'\U006d0073\U006c0061\U0069006c\U0074006e', 5, 2, 0, 10, 1, None, None, 5,
None, None, 75, 'YES', 38)
2012-10-08 17:33:07,360 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00750064\U006f0076\U005f0064\U006d007a\U006e0065\U005f0079\U00610067\U005f0072\U006b0073',
5, u'\U006d0073\U006c0061\U0069006c\U0074006e', 5, 2, 0, 10, 1, None, None, 5,
None, None, 76, 'YES', 38)
2012-10-08 17:33:07,361 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00610064\U00750074\U005f006d\U0061006c\U00740073\U0063005f', 11,
u'\U00610064\U00650074\U00690074\U0065006d', 23, 16, 3, None, 1, None, None, 9,
3, None, 77, 'YES', 111)
2012-10-08 17:33:07,362 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00610064\U00750074\U005f006d\U0061006c\U00740073\U0073005f', 11,
u'\U00610064\U00650074\U00690074\U0065006d', 23, 16, 3, None, 1, None, None, 9,
3, None, 78, 'YES', 111)
2012-10-08 17:33:07,363 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006c006d\U0075006f\U00610076\U006c005f\U00730061\U005f0074\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 79, 'YES', 38)
2012-10-08 17:33:07,364 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006c006d\U0075006f\U00610076\U006c005f\U00730061\U005f0074\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 80, 'YES', 38)
2012-10-08 17:33:07,365 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U00720074\U006b0075\U005f0074\U0061006d\U005f006e\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 81, 'YES', 38)
2012-10-08 17:33:07,367 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U00720074\U006b0075\U005f0074\U0061006d\U005f006e\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 82, 'YES', 38)
2012-10-08 17:33:07,368 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U006f0072\U005f0073\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 83, 'YES', 38)
2012-10-08 17:33:07,369 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U006f0072\U005f0073\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 84, 'YES', 38)
2012-10-08 17:33:07,370 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
85, 'YES', 39)
2012-10-08 17:33:07,371 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
86, 'YES', 39)
2012-10-08 17:33:07,373 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
87, 'YES', 39)
2012-10-08 17:33:07,374 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
88, 'YES', 39)
2012-10-08 17:33:07,375 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073\U005f0031\U00750072\U006e0063', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
89, 'YES', 39)
2012-10-08 17:33:07,376 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073\U005f0033\U00750072\U006e0063', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
90, 'YES', 39)
2012-10-08 17:33:07,377 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
91, 'YES', 39)
2012-10-08 17:33:07,378 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00690074\U006b0073\U0070005f\U005f0073\U005f0035\U00750072\U006e0063', 12,
u'\U00610076\U00630072\U00610068', 1, 1, None, None, 1, None, None, 12, None, 1,
92, 'YES', 39)
2012-10-08 17:33:07,379 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00730070\U00640065\U005f006d\U006b0061\U005f0074\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 93, 'YES', 38)
2012-10-08 17:33:07,381 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00730070\U00640065\U005f006d\U006b0061\U005f0074\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 94, 'YES', 38)
2012-10-08 17:33:07,382 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00720068\U005f006b\U007a0063',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 95, 'YES', 38)
2012-10-08 17:33:07,383 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00640069\U006d005f\U006d006c\U0073005f\U006f0070\U005f006c\U00720068\U005f006b\U006b0073',
4, u'\U006e0069', 10, 4, 0, 10, 1, None, None, 4, None, None, 96, 'YES', 38)
2012-10-08 17:33:07,384 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00720070\U0076006f\U007a0069\U0069006e\U0073005f\U00610074', -7,
u'\U00690062', 1, 1, None, None, 1, None, None, -7, None, None, 97, 'YES', 50)
2012-10-08 17:33:07,385 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0065006d\U0069006e\U005f0074\U00750061\U006f0074\U0061006d\U00690074\U006b0063\U005f0079\U00730070\U00610074',
-7, u'\U00690062', 1, 1, None, None, 0, None, u'\U00310028', -7, None, None, 98,
'NO', 50)
2012-10-08 17:33:07,386 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U0064007a\U005f0061\U00700075\U0061006c\U006e0074\U0076006f\U00740061\U006b005f\U00650072\U00690064',
-7, u'\U00690062', 1, 1, None, None, 0, None, u'\U00310028', -7, None, None, 99,
'NO', 50)
2012-10-08 17:33:07,388 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f',
u'\U00650070\U00690072\U0064006f\U005f0061\U006f0064\U00610073\U006e0068\U00740075\U005f0069\U006f0070\U0069007a\U00650063',
5, u'\U006d0073\U006c0061\U0069006c\U0074006e', 5, 2, 0, 10, 0, None,
u'\U00300028', 5, None, None, 100, 'NO', 52)
2012-10-08 17:33:07,389 DEBUG sqlalchemy.engine.base.Engine Row
(u'\U0046005a\U005f0050\U00520043', u'\U00620064',
u'\U006c006d\U005f006d\U00700073\U006c006f', u'\U00690066\U006d0072', 12,
u'\U00610076\U00630072\U00610068', 50, 50, None, None, 1, None, None, 12, None,
50, 101, 'YES', 39)
Traceback (most recent call last):
File
"/home/lada/.eclipse/org.eclipse.platform_3.8_155965261/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydevd.py",
line 1392, in <module>
debugger.run(setup['file'], None, None)
File
"/home/lada/.eclipse/org.eclipse.platform_3.8_155965261/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydevd.py",
line 1085, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "/home/lada/mine/devel/python/ZFP/zfp_connect.py", line 16, in <module>
x = db.mlm_spol.fetchone()

Michael Bayer

unread,
Oct 8, 2012, 11:45:12 AM10/8/12
to Ladislav Lenart, sqlal...@googlegroups.com
your freetds datasource should be configured with CLIENT_CHARSET=utf8 as I illustrated earlier:

[ms_2005]
host = 172.16.248.128
port = 1213
tds version = 8.0
client charset = UTF8
text size = 50000000




Ladislav Lenart

unread,
Oct 8, 2012, 12:10:07 PM10/8/12
to sqlal...@googlegroups.com, Michael Bayer
Hello.

I adjusted the ODBC/FreeTDS condifugration according to your suggestions but
still get the "NoSuchTableError: mlm_spol".

freetds.conf:

[zfp]
host = 10.230.128.140
port = 1433
tds version = 8.0
asa database = ZFP_CRM
client charset = utf8
text size = 50000000


odbc.ini:

[ODBC Data Sources]
zfp = test

[zfp]
Driver = /usr/lib/libtdsodbc.so
Description = test
Trace = No
Servername = zfp


odbcinst.ini (for the sake of completeness):

[FreeTDS]
Driver = /usr/lib/libtdsodbc.so
UsageCount = 2


The code:

from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup

if __name__ == '__main__':
engine = create_engine("mssql://efractal:efR@cZFP13@zfp", echo='debug')
db = SqlSoup(engine)
x = db.mlm_spol.fetchone()
print x


still fails with NoSuchTableError: mlm_spol

Its debug output is the same as in my previous email which used different
connect style.

And the code that uses db.execute('select * from mlm_spol').fetchone() still
works...

Any other ideas?

Ladislav Lenart

Michael Bayer

unread,
Oct 8, 2012, 1:06:37 PM10/8/12
to Ladislav Lenart, sqlal...@googlegroups.com
if you didnt have this problem with pymssql then please apply the patch I sent previously.

However, I'm going to bet the problem remains as it seems something is not right with how your database and/or client is configured. I'm not familiar with the encoding pattern seen in your information_schema queries. you may have to reproduce the issue using plain SELECT statements against information_schema and then seek outside help.



diff -r 17cab4ad55d5 lib/sqlalchemy/dialects/mssql/pymssql.py
--- a/lib/sqlalchemy/dialects/mssql/pymssql.py Thu Oct 04 18:26:55 2012 -0400
+++ b/lib/sqlalchemy/dialects/mssql/pymssql.py Fri Oct 05 18:46:01 2012 -0400
@@ -80,7 +80,7 @@
def _get_server_version_info(self, connection):
vers = connection.scalar("select @@version")
m = re.match(
- r"Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
+ r"\s*Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
if m:
return tuple(int(x) for x in m.group(1, 2, 3, 4))
else:

Ladislav Lenart

unread,
Oct 9, 2012, 6:03:13 AM10/9/12
to Michael Bayer, sqlal...@googlegroups.com
Hello.

No, I was not able to connect via pymssql. Furthemore I would like to use pyodbc
if it is the preferred way. I just did not know that when I started with pymssql.

It really is a misconfigured character encoding issue in pyodbc / freetds on my
part. I am just clueless as to what should I set to what to make it all work.

The code:

cnxn =
pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0')
cursor = cnxn.cursor()
cursor.execute("select prijmeni from osoba where id_osoba = 462493")
row = cursor.fetchone()
print row

prints:

('Ne?asov', )

The correct value is 'Nečasová'. Ideally I would like to see the following:

(u'Nečasová', )

On a side note, the returned value is one character shorter. I would expected:

('Ne?asov?', )


However, when I connect via tsql, it works correcly:

tsql -S zfp -U efractal
Password:
locale is "cs_CZ.UTF-8"
locale charset is "UTF-8"
using default charset "utf8"
1> select prijmeni from osoba where id_osoba = 462493
2> go
prijmeni
Nečasová
(1 row affected)
1>


I guess I am on my own now. Anyway, thank you for your kind assistance.

Ladislav Lenart

Ladislav Lenart

unread,
Oct 9, 2012, 6:39:55 AM10/9/12
to sqlal...@googlegroups.com, Michael Bayer
Also, this works correctly:

isql -v zfp efractal efR@cZFP13
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select prijmeni from osoba where id_osoba = 462493
prijmeni


Nečasová


SQLRowCount returns 1
1 rows fetched
SQL>


This does not:

iusql -v zfp efractal efR@cZFP13
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select prijmeni from osoba where id_osoba = 462493
prijmeni


asov�


SQLRowCount returns 1
1 rows fetched
SQL>


Ladislav Lenart

Michael Bayer

unread,
Oct 9, 2012, 10:19:33 AM10/9/12
to Ladislav Lenart, sqlal...@googlegroups.com

On Oct 9, 2012, at 6:03 AM, Ladislav Lenart wrote:

> Hello.
>
> No, I was not able to connect via pymssql. Furthemore I would like to use pyodbc
> if it is the preferred way. I just did not know that when I started with pymssql.
>
> It really is a misconfigured character encoding issue in pyodbc / freetds on my
> part. I am just clueless as to what should I set to what to make it all work.
>
> The code:
>
> cnxn =
> pyodbc.connect('DRIVER={FreeTDS};SERVER=10.230.128.140;PORT=1433;DATABASE=ZFP_CRM;UID=efractal;PWD=efR@cZFP13;TDS_VERSION=8.0')
> cursor = cnxn.cursor()
> cursor.execute("select prijmeni from osoba where id_osoba = 462493")
> row = cursor.fetchone()
> print row
>
> prints:
>
> ('Ne?asov', )

you definitely, definitely need "client charset" to be part of your FreeTDS config, either in that URL string up there (not sure if that's supported), or preferably in your freetds.conf. pyodbc is pretty sensitive to this.

> However, when I connect via tsql, it works correcly:

yeah, the whole FreeTDS story is awful, I don't understand any of it either. I'm still at "wave a dead chicken" stage with FreeTDS (http://dictionary.reference.com/browse/wave+a+dead+chicken).

Ladislav Lenart

unread,
Oct 9, 2012, 11:07:28 AM10/9/12
to sqlal...@googlegroups.com, Michael Bayer
Hello.

I made some progress. I have client charset in my freetds config file. I am also
certain that the config and the charset is used by pyodbc / freetds combo.
Without it I get 'Ne?...'. With it I get back a str encoded in utf-8. I also
enabled freetds logging where I clearly see two conversions being prepared:

iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion
iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion

If I comment the client charset line in the config, I see:

iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion

I beleive the second one has to do with description_encoding which is 'latin-1'
by default (in MSDialect_pyodbc.__init__). However I tried to set it to utf-8,
utf-16le and whatnot without any effect (in debugger).

I also found out that my problem is not in information_schema per se but with
all nvarchar values / columns. For example this

u'\U0073006f\U0062006f'

is actually a garbled string 'osob':

u'\U0073006f\U0062006f'
u'\U006f0073\U006f0062'
u'\u006f\u0073\u006f\u0062' = u'osob'

though I have no idea how and where it comes into existence. Furthermore the
correct value is 'osoba' (a table name). I guess the conversion stripped out the
odd character.

Current state of nvarchar processing in my dev env:
tsql OK
isql OK
pyodbc KO


Ladislav Lenart

Ladislav Lenart

unread,
Oct 10, 2012, 11:23:30 AM10/10/12
to sqlal...@googlegroups.com, Michael Bayer
Hello!

I finally managed to solve the problem (with the great help of my colleagues)!
The culprit: python-pyodbc package in Debian/testing is nearly THREE years old
now (version 2.1.7). I removed it and easy-installed the version 3.0.6 which
does not have the encoding bug anymore. Now everything works like a charm,
inluding SqlSoup. I even receive unicode objects directly for both VARCHAR and
NVARCHAR columns!


For future reference: If you want to connect to MSSQL server from a Linux
(Debian) machine, you need to...

[1] Install unixodbc:

aptitude install unixodbc

I also have unixodbc-dev installed, but I am not sure if it is necessary.


[2] Install freetds and the driver:

aptitude install freetds-bin tdsodbc


[3] Edit /etc/odbcinst.ini (note: DO NOT indent lines in the odbc config files!):

[FreeTDS]
# See dpkg -L tdsodbc | grep libtdsodbc
Driver = /path/to/libtdsodbc.so
UsageCount = 1


[4] Edit /etc/odbc.ini:

[ODBC Data Sources]
zfp = test

[zfp]
Driver = FreeTDS # The section name from /etd/odbcinst.ini
Description = test
Servername = zfp # The section name from /etc/freetds/freetds.conf (see below)
# Do NOT use option 'Server'.
TDS_Version = 8.0 # Important


[5] Edit /etc/freetds/freetds.conf:

[zfp]
host = 10.230.128.140
port = 1433
asa database = ZFP_CRM # Database name
tds version = 8.0 # Important
client charset = UTF-8 # Important
text size = 50000000


[6] Install python2.7-dev which is needed for the next step, because pyodbc
compiles some stuff and thus needs header files:

aptitude install python2.7-dev


[7] Install pyodbc "manually" (i.e. without aptitude):

easyinstall pyodbc


[8] Verify that freetds works (zfp is the section name in
/etc/freetds/freetds.conf):

tsql -S zfp -U username

Try to select some strings to see that they display correctly.


[9] Verify that unixodbc works (zfp here is the section name in /etc/odbc.ini):

isql zfp username password

Again, try to select some strings to see that they display correctly.


[10] Verify that pyodbc works:

import pyodbc
cnxn = pyodbc.connect("DSN=zfp;UID=username;PWD=password", unicode_results=True)
cursor = cnxn.cursor()
# Select some VARCHAR column.
(x,) = cursor.execute("select...").fetchone()
# Should print a meaningful unicode representation of the result string.
print repr(x)
# Repeat the same for NVARCHAR column. The result should be the same, i.e.
# proper unicode representation).
(x,) = cursor.execute("select...").fetchone()
print repr(x)


[11] Connect via SQLAlchemy:

from sqlalchemy.engine import create_engine
from sqlalchemy.ext.sqlsoup import SqlSoup

# zfp here is the section name in /etc/odbc.ini
engine = create_engine(
"mssql+pyodbc://username:password@zfp",
convert_unicode=True,
echo='debug'
)
db = SqlSoup(engine)
# Same as in step 10
db.execute(...)
# OR
x = db.some_table.filter(...).one()


Enjoy!

Ladislav Lenart


Yap Sok Ann

unread,
Oct 13, 2012, 12:20:39 AM10/13/12
to sqlal...@googlegroups.com
On Tuesday, October 9, 2012 10:19:34 PM UTC+8, Michael Bayer wrote:

yeah, the whole FreeTDS story is awful, I don't understand any of it either.     I'm still at "wave a dead chicken" stage with  FreeTDS (http://dictionary.reference.com/browse/wave+a+dead+chicken).

The ODBC Driver 1.0 for Linux from Microsoft (http://www.microsoft.com/en-us/download/details.aspx?id=28160) works very well for me. It allows me to use the same driver (SQL Server Native Client 11.0) on both Linux-based development machine and Windows-based production server.

With this added to odbcinst.ini:

[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1

I can then use a simple SQLAlchemy URL:

mssql+pyodbc://<username>:<password>@<server>/<database>?driver=SQL+Server+Native+Client+11.0

Michael Bayer

unread,
Oct 15, 2012, 1:24:12 AM10/15/12
to sqlal...@googlegroups.com
OK this is really fascinating, as my sysadmin scared me away from MS's product, but if you're saying its working, then that is really amazing.  Of course the proof would be that I can run unicode through it in any way I see fit and it wouldn't choke.  Will try to look into this, as never using FreeTDS again would be a good thing.


Reply all
Reply to author
Forward
0 new messages