[gameprogrammer] Re: Slightly offtopic: SQL Command


PostgreSQL at least returns the oid of the inserted tuple.
This of course is unique. This can be used to get any auto_increment etc stuff whit ease. So check the behaviour of the DB you use. It can provide some similar way to get that.

PS. How it seams that every time I encounter new DB system PostgreSQL seams to do things right or better. :) Or maybe I'm a litle bit biased to PostgreSQL. ;)

I'm trying to implement this as described here:
http://developer.postgresql.org/pgdocs/postgres/sql-insert.html

but RETURNING doesn't work:

BEGIN;
CREATE TABLE blah(name integer);
INSERT INTO blah(name) VALUES (0) RETURNING name;
COMMIT;

ERROR:  syntax error at or near "RETURNING" at character 79

Ideas?

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: