Hi all,

trying to figure out how i could add an arbitrary string to an sql.expression.

If have something like this:

s = select([columns])
if cond:
        s = s.where(text(cond))
if addtl:
        # how to tack addtl to the end of the statement?
        # this does not work
        s = s + text(addtl)

Basically i have an legacy interface i need to base on sqlalchemy that takes 
a list of columns, a where clause and an 'additional' thing. Additional was 
used for things like 'order by', 'having' etc. but can be anything basically.

e.g.
columns = [test.c.foo, test.c.bar]
cond = """foo=20"""
addtl = """some sql stuff"""

and i want it to transform to:
SELECT test.foo, test.bar FROM test WHERE foo=20 some sql stuff

So i try to find a good way to tack such a SQL string at the end of a 
sqlexpression, but haven't seen it yet. Is there a way?

Michael

-- 
Michael Schlenker
Software Engineer

CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
Wiener Straße 1-3               Fax:    +49 (421) 20153-41
28359 Bremen
http://www.contact.de/          E-Mail: [EMAIL PROTECTED]

Sitz der Gesellschaft: Bremen | Geschäftsführer: Karl Heinz Zachries
Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to