SQLite is not one of the supported DBs.
Keyed tables are only supported in MS SQL, DB2, Ingres and Informix.
Other DB engines (except SQLite)might be added following section E in
http://groups.google.com/group/web2py/msg/c9848792a8999c5f


On May 8, 2:48 pm, Iceberg <[email protected]> wrote:
> I am not dealing with legacy tables, I am just starting a new db and
> wondering whether I can set multiple primary key, in order to
> eliminate the chance of duplicated data.
>
> For example.
>
>         db = DAL('sqlite://storage.sqlite')
>         db.define_table('account',
>           Field('given_name'),
>           Field('surname'),
>           Field('phone_number'),
>           primarykey=['given_name','surname'])
>
> On May9, 3:23am, DenesL <[email protected]> wrote:
>
> > Multiple primary keys should work if you are defining legacy tables in
> > one of the supported DB engines.
> > Are you using MS SQL, DB2, Ingres or Informix?
> > Can we see the model?
>
> > On May 8, 5:57 am, Iceberg <[email protected]> wrote:
>
> > > Hi there,
>
> > > I am fiddling multiple primary keys. Somehow I managed to find
> > > following example inside gluon/sql.py
>
> > >         db.define_table('account',
> > >           Field('accnum','integer'),
> > >           Field('acctype'),
> > >           Field('accdesc'),
> > >           primarykey=['accnum','acctype'])
>
> > > But running the example throws:
>
> > > Traceback (most recent call last):
> > >   ......
> > >   File "C:\DOWNLOAD\google_appengine\web2py\gluon\sql.py", line 2112,
> > > in __init__
> > >     raise SyntaxError, 'invalid table "%s" attribute: %s' %
> > > (tablename, k)
> > > SyntaxError: invalid table "account" attribute: sequence_name
>
> > > What did I do wrong?
>
> > > Iceberg

Reply via email to