I am having the same problem, I am trying to make my web app database independant, but ran into the mysql_insert_id to ORACLE conundrum, This is the only way I have found that actually returns the new key.
--Snip here--
There is not a single PHP function to support this, but if you are
using the OCI functions you are able to achieve the same thing. You need
to use a RETURNING clause on your INSERT statement, and return into a
bind variable. Here is a rough example:
Say we have a table called USERS and it stores a username and password,
along with a userid which is a number that identified a user. We have
a sequence that we use to generate these userid identifiers. And
we have a trigger that reads the next number from the sequences and
uses it in the insert statement. We can pass the number back into
PHP using code that looks like this:
$Connection = OCILogon($Username, $Password, $TNS);
$Query = "insert into users ( username, password )
values ( 'Tenchi', 'Muyo' )
returning userid into :userid";
$Statement = OCIParse($Query, Connection);
OCIBind($Statement, ':userid', $UserID, 32);
OCIExecute($Statement, OCI_DEFAULT);
OCIComment($Connection);
OCIFreeStatement($Statement);
printf("UserID returned = %s<BR>\n", $UserID);