Re: callproc, string formatting

Tim Roberts <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.