In Oracle you do in a completely different way as there is no such thing as an auto-increment column.
You create a SEQUENCE that will create the primary keys for your table, then you either get the sequence value before you do the insert, or you retrieve the lates sequence value after the insert:
Code:
CREATE TABLE my_table (id integer primary key);
CREATE SEQUENCE my_id_sequence;
Possibility one, retrieve the ID after the insert:
Code:
INSERT INTO my_table (id) values (my_id_sequence.nextval);
SELECT my_id_sequence.currval FROM dual
Possibility two, retrieve the ID first then do the insert:
Code:
SELECT my_id_sequence.nextval
INTO my_id_variable
FROM dual;
INSERT INTO my_table (id) values (my_id_variable)