On Sep 23, 2008, at 4:24 PM, Rick Morrison wrote:
> class MSBinary(sqltypes.Binary):
> def bind_processor(self, dialect):
> def process(value):
> return '0x' + value.encode('hex')
> return process
>
> ...the issue is that the emitted value is getting quoted somewhere
> after the type conversion:
>
> INSERT INTO binary_table VALUES(...., '0x6df02da', ...)
>
> but MSSQL's parser can recognize the '0x' prefix and wants the value
> unquoted:
>
> INSERT INTO binary_table VALUES(...., 0x6df02da, ...)
>
> So how do I get the Dialect to drop the quoting behavior for the
> return from bind_processor() ?
SQLA doesn't quote bind values. It passes bind parameters, so this is
likely pyodbc assigning quoting.
The first step here is to get a full binary round trip working with
only pyodbc, no SQLA in use. The dialect can then be adjusted to do
whatever is needed in that regard.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---