[gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Kevin Jenkins <gameprogrammer@xxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Fri, 10 Nov 2006 15:56:46 -0800
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
- Follow-Ups:
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Sami Näätänen
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Matthew Weigel
Other related posts:
- » [gameprogrammer] Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [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. ;)
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Sami Näätänen
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Matthew Weigel