Re: lisp mail archive software

John DeSoi <[email protected]> Mon, 7 Jul 2003 08:17:27 -0400
Newsgroups gmane.lisp.clump
Message-ID <[email protected]>
On Monday, July 7, 2003, at 03:24 AM, Sven Van Caekenberghe wrote:

> What Miles means, I think, is:
>
> insert into customers (id, name) values (nextval('name_of_sequence'), 
> 'Foobar');
>

Right, but if the type of the id column is 'serial' then the nextval is 
assigned automatically when you do an insert so you don't have to do it 
explicitly (i.e. call nextval in your sql insert). The original 
statement was "special select after inserting a new row with an 
autoincrement key."

> If this is what he means, I don't see anything special about it, it 
> would work with any SQL interface, and certainly with pg.lisp

Yes, I'm sure every SQL database has something like this, so it is just 
a matter of knowing the right syntax. But sequences are not part of the 
SQL standard, so it is likely some databases handle it differently.

Best,

John DeSoi, Ph.D.