Database autoincrement columns : howto do do them?

Hanasaki JiJi hanasaki at hanaden.com
Sat Jul 20 15:11:46 CDT 2002


Sorry for being a bit off the Linux topic ...

I remember someone was talking to me at the meeting after the meeting 
and seemed to be an Oracle Guru!

Is there anyway to acheive:
	Database independant way to do autoincrement columns
	If not Database Independant, how about just for Oracle?

Triggers have been suggested; however I would like to stay away from 
stored procedures.

Someone also suggested:
	INSERT INTO [table] (ID, cols..) VALUES (MAX(ID)+1, ....);
	<ID is an INT, PRIMARYKEY, with UNIQUE INDEX>

Development has been done on a small RDBMS that support they key 
"IDENTITY" for a column type.  This results in an INT/PRIMARYKY that 
autoincs on insert.

Thank you.




More information about the Kclug mailing list