D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] postgresql inserts





Robert Nowik wrote:

Hi,
Not really a linux specific problem, but in postgreSQL i am trying to have an INSERT statement, that has a serial as the only unique identifier. This serial is not set by myself (postgres handles this) but as this is the only unqiue identifier, i need to return it as I do the insert. Any suggestions?


you need to get back the id value created by the sequence function when inserting a record?

there is a way that postgresql handles this and it does it well - i have had to do the same thing on MS SQL server and had to work around it with a global variable - but i believe postgresql has this built in.

i can't remember what it is though it should be on www.postgresql.org somewhere

please post back if you find it,

kev

Cheers
Rob Nowik




--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly