On Tue, 2012-05-15 at 20:32 -0400, Adam Tauno Williams wrote: > On Tue, 2012-05-15 at 19:51 -0400, Adam Tauno Williams wrote: > > On Tue, 2012-05-15 at 16:27 -0400, Michael Bayer wrote: > > > Could be tough, you'd need to test it against the informix dbapi > > > directly, > > using bound parameters, to see what it needs. Could be a typing issue. > > Ok, I got a response from an Informix guru and maintainer of the > > informix dbapi. > > <quote> > > I see two different approaches around this issue: > > * Use literal values instead of bound parameters in the projection > > clause. > > * If you must use bound parameters, use type casts for the parameters > > that are used in the projection clause. For example: CASE WHEN > > (xrefr.xr_supersede = :1) THEN :2::int ELSE :3::int > > </quote> > > I assume this same kind of issue must be addressed in other dialects??? > I've constructed a sequence that seems to work perfectly.
For anyone in the future [list archives & search engines] trying to use the Informix dialect I've posted a BLOG post about this issue: <http://www.whitemiceconsulting.com/2012/05/informix-dialect-with-case-derived.html> > class XrefrRecord(Base): > > __tablename__ = 'xrefr' > record_id = Column("xr_serial_no", Integer, primary_key=True) > sku = Column("xr_stock_no", Integer, nullable=False) > .... > list_price = Column("xr_list_price", Float(precision=3)) > _supersede = Column("xr_supersede", String(1)) > is_supersede = column_property( > case( [ ( _supersede == 'S', > literal_column('1', Integer) ) ], > else_ = literal_column('0', Integer) > ) > ) > > __mapper_args__ = { 'polymorphic_on': is_supersede } > > > class Cross(XrefrRecord): > __mapper_args__ = {'polymorphic_identity': 0} > > > class Supersede(XrefrRecord): > __mapper_args__ = {'polymorphic_identity':
signature.asc
Description: This is a digitally signed message part
