summaryrefslogtreecommitdiff
path: root/docs/topics/db/sql.txt
diff options
context:
space:
mode:
authorDavid Sanders <david@retul.com>2014-02-20 11:32:04 -0700
committerDavid Sanders <david@retul.com>2014-02-20 11:32:04 -0700
commitadcedfe8ba2376ab5106f0d6704770be95db6f12 (patch)
tree13db8febde9bfad4bd2bcd19a1a94b1b94b67958 /docs/topics/db/sql.txt
parent6dfd02f88c49ce0d39191088863f6f45b0d7784e (diff)
downloaddjango-adcedfe8ba2376ab5106f0d6704770be95db6f12.tar.gz
Capitalize SQL keywords
Diffstat (limited to 'docs/topics/db/sql.txt')
-rw-r--r--docs/topics/db/sql.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt
index 9245037d59..a2c621962b 100644
--- a/docs/topics/db/sql.txt
+++ b/docs/topics/db/sql.txt
@@ -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