Error in book re Indexes

0 views
Skip to first unread message

geoff

unread,
Sep 13, 2010, 4:05:54 PM9/13/10
to web...@googlegroups.com
http://web2py.com/book/default/chapter/06#Indexes

Here is an example of how to create an index using SQL in SQLite:

1.
2.
3.
>>> db = DAL('sqlite://storage.db')
>>> db.define_table('person', Field('name'))
>>> db.executesql('CREATE INDEX IF NOT EXISTS myidx ON person name;)

Other database dialects have very similar syntaxes but may not support
the optional "IF NOT EXISTS" directive.


Line 3 should be
db.executesql('CREATE INDEX IF NOT EXISTS myidx ON person(name);')

Reply all
Reply to author
Forward
0 new messages