I am not familiar with Interbase but most database have support for atomic autoincrement ids (Oracle calls them sequences, MySQL has an autoincrement flags for columns). ========================================================================== Andreas Jung andreas@digicool.com Digital Creations "Zope Dealers" http://www.zope.org ----- Original Message ----- From: "Fabrizio" <facelle@libero.it> To: <zope@zope.org> Sent: Samstag, 14. Juli 2001 15:55 Subject: [Zope] Z Sql method newbie question
Hallo,
Newbie. Zope 2.3.3 on Win98. Interbase 6.0 through gvibDA.
I have a database table with three fields : id, name, surname. I want to create a simple Z Sql method that adds a new record to the table and automatically assigns an increased id value to the new record .
I tried something like :
insert into table(name, surname) values ( max (id) + 1, <dtml-sqlvar name type="string">, <dtml-sqlvar surname type="string"> )
(Method arguments are : name, surname).
But It does not work as I expect.
Any help will be appreciated. Thanks in advance.
Fabrizio C.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )