Shai:
I think that you are showing how rotten this whole "paramstyle" mess is:
the thing you are describing is, IIUC, "pyformat" paramstyle. "named" uses
a ":name" SQL statement syntax, and expects a mapping of parameters. My
understanding was that Oracle expected that one. I am only an egg.
Here's my understanding:
'qmark' uses '?' inside SQL statements, and expects parameters in a
sequence, to be applied in order.
'format' uses '%s' inside SQL statements, and expects parameters in a
sequence, to be applied in order.
'numeric' uses ":n" (where 'n' is an integer), and expects parameters in a
sequence, to be applied by index number 'n'.
'named' uses ":name" inside SQL statements, and expects parameters in a
mapping, to be applied by name.
'pyformat' uses "%(name)s", and expects parameters in a mapping.
The intent of PEP-249 is that the ORM should look at the value of
adapter.paramstyle and use that format, whatever it happens to be.
Clearly, that is not happening. Should it be put on the To-do list for
some future version of django, at least to supporting the two expected
future winners in the parmstyle competition ('named', 'qmark')?
--
Vernon Cole
On Thursday, May 16, 2013 7:49:47 PM UTC+1, Shai Berger wrote:
>
> On Thursday 16 May 2013, VernonCole wrote:
> > I noticed in a recent post that there is an outstanding patch for Oracle
> > for support of 'named' paramstyle.
> >
>
> As the author of that patch, I should probably clarify that it is a
> "format"
> style -- %(name)s -- not a "named" -- :name -- style.
>
> AFAIK, that style is currenly supported by all core django backends (well,
> except Oracle, of course); I know our code which uses it has been
> successfully
> run against SQLite and Postgres, and I suspect django-pyodbc also supports
> it.
> It has its problems, both with respect to Python string interpolation and
> to
> SQL's pattern operator, but AFAIK it is the most common in use.
>
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.