From: Tom Sawyer Date: 2003-01-03T13:46:32+09:00 Subject: Re: Ruby DBI continuing on with the variaous DBI questions, now i'm stuck on a cross-database issue and would like recommendations. as it stands when i insert a new record into a table, i then do: "SELECT currval('table_idfield_seq') as recid;" to get the latest automatically generated record id. and thus know which record i just inserted. but this seems to me like a jerry-rig. i don't like it and i doubt it works on anything but postgresql. what's the best way to deal with this? how does one get auto generated id fields in such a way as to be cross-compatible? or am i mistaken in using auto generated id feilds in the first place? thanks, transami