Re: callproc, string formatting
Brian Jones <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
Sorry - reply went to person instead of list :( On Wed, Nov 25, 2009 at 1:26 PM, Tim Roberts <[email protected]> wrote: > Brian Jones wrote: > > > > My next attempt looked like this: > > --------------------------- snip --------------------------- > > curs.execute("""SELECT * FROM myapp.new_user( %(fname)s, %(lname)s, > > %(dob)s, %(city)s, %(state)s, %(zip)s""", qdict) > > --------------------------- /snip --------------------------- > > > > Effectively just replacing the "%" with a "," to pass an actual param > > list instead of passing only one arg that contains a string formatting > > operation. > > > > But this winds up with unquoted strings as well. > > Well, that is exactly the right way to do it. You shouldn't end up with > unquoted strings. Were they ALL unquoted, or just certain ones? Are > the values in qdict straight strings, or are they some fancier type that > reduces to strings? > > -- > Tim Roberts, [email protected] > Providenza & Boekelheide, Inc. > > _______________________________________________ > Psycopg mailing list > Psycopg-IAPFreCvJWPBWskQ1e/[email protected] > http://lists.initd.org/mailman/listinfo/psycopg > -- Brian K. Jones Python Magazine http://www.pythonmagazine.com My Blog http://www.protocolostomy.com _______________________________________________ Psycopg mailing list Psycopg-IAPFreCvJWPBWskQ1e/[email protected] http://lists.initd.org/mailman/listinfo/psycopg