Permalink
Browse files

Capitalize SQL keywords

  • Loading branch information...
David Sanders
David Sanders committed Feb 20, 2014
1 parent 6dfd02f commit adcedfe8ba2376ab5106f0d6704770be95db6f12
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/topics/db/sql.txt
View
@@ -86,7 +86,7 @@ had ``Person`` data in it, you could easily map it into ``Person`` instances::
>>> Person.objects.raw('''SELECT first AS first_name,
... last AS last_name,
... bd AS birth_date,
- ... pk as id,
+ ... pk AS id,
... FROM some_other_table''')
As long as the names match, the model instances will be created correctly.
@@ -247,7 +247,7 @@ Note that if you want to include literal percent signs in the query, you have to
double them in the case you are passing parameters::
cursor.execute("SELECT foo FROM bar WHERE baz = '30%'")
- cursor.execute("SELECT foo FROM bar WHERE baz = '30%%' and id = %s", [self.id])
+ cursor.execute("SELECT foo FROM bar WHERE baz = '30%%' AND id = %s", [self.id])
If you are using :doc:`more than one database </topics/db/multi-db>`, you can
use ``django.db.connections`` to obtain the connection (and cursor) for a

0 comments on commit adcedfe

Please sign in to comment.