SQLAlchemy doesn't need to do anything with the XML type so having it reflect as "nulltype" is not an issue. its only a warning.
On May 4, 2011, at 4:00 PM, Thang Nguyen wrote: > thanks Michael. I tried with 0.6.7 and looks like it does not > regconize xml datatype. Here is the message: > > Did not recognize type 'xml' of column 'test' > ret = fn(self, con, *args, **kw) > > Since our production MSSQL database is using xml datatype, is there a > work around to this? Please suggest. thanks much. > > TPN > > > > On Wed, May 4, 2011 at 12:22 PM, Michael Bayer <mike...@zzzcomputing.com> > wrote: >> it likely an old bug in 0.5 can you try 0.6.7 ? unknown types should be >> ignored during reflection. >> >> >> On May 4, 2011, at 3:04 PM, Thang Nguyen wrote: >> >>> Hi, >>> >>> I am running into an error with sqlalchemy when using XML datatype in >>> MSSQL (existing table). My test_table just has two columns: id, test. >>> The test column is xml datatype. Is XML datatype supported? Or is >>> it something I did not do correctly? >>> Thanks for your help in advance. >>> TPN >>> >>> >>> Here is the statement that generates the error: >>> ================================= >>> >>> t_test_table = Table('test_table', metadata, autoload=True, >>> autoload_with=eng) >>> >>> Here is the error: >>> ============ >>> >>> File "./ePackages/sqlalchemy/databases/mssql.py", line 1240, in reflecttable >>> if issubclass(coltype, sqltypes.Numeric): >>> TypeError: issubclass() arg 1 must be a class >>> >>> The version of sqlalchemy: >>> =================== >>>>>> import sqlalchemy >>>>>> print sqlalchemy.__version__ >>> 0.5.5 >>> >>> Here is the script (test_xml.py): >>> ====================== >>> >>> import ePackages >>> import pyodbc >>> import sqlalchemy >>> from sqlalchemy import * >>> >>> session = None >>> metadata = MetaData() >>> >>> def pycon(): >>> return >>> pyodbc.connect("DRIVER={FreeTDS};SERVER=myserver;DATABASE=MYDATABASE;PORT=1435;UID=MYUSER;PWD=MYPASS") >>> >>> def init_model(eng): >>> global session, metadata >>> >>> metadata.bind = eng >>> t_test_table = Table('test_table', metadata, autoload=True, >>> autoload_with=eng) >>> sm = sqlalchemy.orm.sessionmaker(autoflush=False, >>> autocommit=False, bind=eng) >>> session = sqlalchemy.orm.scoped_session(sm) >>> >>> print "testpoint 1" >>> engine = create_engine('mssql://', creator=pycon, echo=True) >>> print "testpoint 2" >>> init_model(engine) >>> print "testpoint 3" >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "sqlalchemy" group. >>> To post to this group, send email to sqlalchemy@googlegroups.com. >>> To unsubscribe from this group, send email to >>> sqlalchemy+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/sqlalchemy?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sqlalchemy" group. >> To post to this group, send email to sqlalchemy@googlegroups.com. >> To unsubscribe from this group, send email to >> sqlalchemy+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/sqlalchemy?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.