[sqlalchemy] Re: OID usage

2007-09-27 Thread sdobrev

just some ideas.

 Here is an example of a properly interpreted row using the
 dbutils.OID class:
  08C82B7C6A844743::SDRAM::64Mb::Marketing::0C::70C::DC Electrical
 Characteristics

 Here is the binding statement being generated by SqlAlchemy:
 2007-09-27 13:32:12,444 INFO sqlalchemy.engine.base.Engine.0x..cL
 {'spec_section_symbols_section_OID': '\x08\xc8+|j\x84GC'}

 I know in Perl I have to format the query without quotes or I don't
 get any results. Something like this:
 select * from table where section_OID=0x08C82B7C6A844743

the dict shows that your value is sent/assumed a raw byte-string, 
while what u're suggesting in the perl example is that the server 
expects a sort of hexadecimal longint representation. Are these 
equivalent? maybe u need to convert from one to another?

 I am not receiving any type of error, just an empty result set. I
 have verified that the OID is being interpreted correctly by
 running an interactive sql statement on the interpreted value
 shown.

 I'm wondering if SqlAlchemy is quoting the parameter when it is
 bound or if anyone has any other suggestions as to why I am not
 getting any results.
insert one row via sqlalchey with OID=aabbccddeeff and see what u get.
may give u idea of what conversion happens on the way.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: OID usage

2007-09-27 Thread Michael Bayer


On Sep 27, 2007, at 4:11 PM, Eric N wrote:


 I'm wondering if SqlAlchemy is quoting the parameter when it is bound
 or if anyone has any other suggestions as to why I am not getting any
 results.

we're not quoting anything when its bound...what gets returned from  
convert_bind_param is what gets sent as a bind param to cursor.execute 
().  your custom type class seems fine.

what you should do here first is make a short program using DBAPI  
only (which DBAPI are you using ?  the three available for MS-SQL  
vary widely in their functionality), and try to get the query to work  
using a straight cursor.execute().  there could be issues with  
comparisons to binary fields or with the DBAPI's ability to bind a  
binary field; a call to setinputsizes() may even be needed.  once its  
determined exactly what your DBAPI needs (or if its possible at  
all).  any additional data massaging needed on the SQLAlchemy side  
can then be addressed.

as a last resort you can inject direct text into a SQL statement  
using a string...with ORM it would look like query.filter 
(section_OID=0x08C82B7C6A844743) .

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---