[IronPython] Making adonet-dbapi's dbapi a drop-in replacement in django-mssql

Jeff Hardy jdhardy at gmail.com
Tue Oct 27 15:01:47 CET 2009


2009/10/27 Markus Törnqvist <mjt at nysv.org>:
> Hi!

Well, you can inore my previous email :)

> Creating cursor 501
> Creating cursor 5
> adonet2dbapi: executing 'SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' UNION SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS' with '()'
> Creating cursor 303
> adonet2dbapi: executing 'SELECT [django_content_type].[id], [django_content_type].[name], [django_content_type].[app_label], [django_content_type].[model] FROM [django_content_type] WHERE ([django_content_type].[model] = %s  AND [django_content_type].[app_label] = %s ) ORDER BY [django_content_type].[name] ASC' with '('permission', 'auth')'
>
> Environment Error: System.Data.SqlClient.SqlException: Incorrect syntax near 's'.

It's the %s parameter markers that Django uses; they need to be
converted to whatever SQL Server uses (Vernon would probably know
better then me). The easiest way is query % params; building the
params tuple is the hard part. It's been a while since I looked at the
mssql.py code, so I don't remember the details.

- Jeff



More information about the Ironpython-users mailing list