From: Timothy S. <ti...@op...> - 2004-11-29 21:19:35
|
I've already solved this, but. sql gives you so many abilities, why should you be limited to providing aruguement to a single clause? it really is very limiting. theres no way to provide a variable list of arguements to your query. Chuck Bearden wrote: >On Sun, 28 Nov 2004 10:42:12 +0100, Karsten Hilbert ><kar...@gm...> wrote: >[...] > > >>The query arguments are intended to be values for the *where* >>clause, no ? >> >> > >I am inclined to agree with Karsten that query arguments are for the >WHERE clause. To insert the names of columns to be retrieved into a >SELECT statement at runtime, I would use Python string formatting and >a helper function that returns a tuple of days of the week: > >def daysOfWeek(): > <build list 'L' with range of days> > return tuple(L) >[...] >cur.excute("Select %s from table" % (daysOfWeek())) > >Chuck > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://productguide.itmanagersjournal.com/ >_______________________________________________ >Pypgsql-users mailing list >Pyp...@li... >https://lists.sourceforge.net/lists/listinfo/pypgsql-users > > > > |