Manually set Identity field in Oracle
Posted: Thu 25 Jul 2019 21:06
Hello everyone, I apologize in advance if this has already been asked.
We're a VB.Net shop with two Oracle databases, let's call one local and the other web. Local has a table with an ID column that is populated via a trigger, this works just fine in our code; the insert statement is generated correctly and the ID is brought back into the object. What I need to do is then take that ID value and use it in the INSERT statement that's being generated for inserting into the web database version of that same table. So basically:
Insert into local.table (foo, bar) values (:p1, :p2) returning ID into :ret1
Insert into web.table (id, foo, bar) values (:ret1, :p1, :p2)
Any help would be appreciated.
We're a VB.Net shop with two Oracle databases, let's call one local and the other web. Local has a table with an ID column that is populated via a trigger, this works just fine in our code; the insert statement is generated correctly and the ID is brought back into the object. What I need to do is then take that ID value and use it in the INSERT statement that's being generated for inserting into the web database version of that same table. So basically:
Insert into local.table (foo, bar) values (:p1, :p2) returning ID into :ret1
Insert into web.table (id, foo, bar) values (:ret1, :p1, :p2)
Any help would be appreciated.