Alternatively a possibility to replace a bindparam Expression with some other Expression would do it too...
2010/4/21 Paul Balomiri <paulbalom...@gmail.com>: > Hi, > Is it possible to supply bindparam a clause type? > > I want to execute a query of the form > > select * from f(:a, :b,:c) > > where :b might be either a String or a function. > if :b is a function, i'd like to do something like: > > s=select(["col1" , "col2", "col3"], from_obj=func.f(bindparam('a'), > bindparam('b' , type=Clause) ) ) > and > clause_variant_1 = func.bbox( bindparam('x1') , bindparam('y1'), > bindparam('y2'), bindparam('y2')) > clause_variant_2= text("some funny value") > when i execute o'd like to do something like: > > > connection.execute(s, a="vala", c="valc", b= clause_variant_1, x1=11, > x2=12, y1=2, y2=3 ) > or, alernativelly > connection.execute(s, a="vala", c="valc", b= clause_variant_2) > > I already realized that i could set parameters with params, and then compile > SQL expressions > would perhaps this be a more accurate approach ?: > connection.execute(s, a="vala", c="valc", b= clause_variant_1.params( > x1=11, x2=12, y1=2, y2=3).compile() ). > > I'm kind of stuck here > > cheers, > Paul > > > > > -- paulbalom...@gmail.com -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.