On Mon, 2009-05-04 at 10:31 -0700, MikeL wrote:
> I figured it out. I had to run cursor.execute for the SET and the
> SELECT line and it managed to remember the @row being 0 between them.
> Though it would be nice if a django solution exists.

You found the Django solution already: use cursor.execute(). We
intentionally don't even attempt to provide things like what you're
doing wrapped up in a Python layer. It's essentially unbounded amounts
of work to come up with an API to hide the use of SQL, come up with SQL
that works on all our backends and is usable by third-party database
backends, etc, etc. Instead, we provide a way for you to talk SQL when
that's the appropriate solution to your problem.

It sounds, from your reply here, that you were originally trying to pass
multiple statements through in a single cursor.execute() call. It's not
well-defined in PEP-249 as to whether database wrappers handle that or
not and the behaviour is a bit database server specific (both in whether
it works and in the how errors are reported, if at all).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to