I'm not sure if it's ANSI standard, but if not it should be. Oracle supports a returning clause as part of an insert statement. This means that you can get back any column from the table you just inserted/updated.
i.e.
if we had a table called some_table defined as
PK_Col number
another_col varchar2
and as in your example the PK got automatically done for you
insert into some_table
(another_col)
values ('ABC')
returning pk_col into my_variable;
would put the value used for pk_col into your local variable my_variable.
This may be specific to Oracle, but if you post your RDBMS maybe someone can tell you how to do it for that system.