Is it possible to use commandtext for function mapping?
Posted: Tue 21 Apr 2009 10:11
I've tried without success to write function mappings for insert/update commands.
When working with sql server we had a function mapping for the update with a commandtext section that contained a sql statement that does the update/insert and afterwards another select statement for the resultbinding, for example:
-- insert row to history table
insert into ... select ...
-- update the row
update table set ...
-- get the results for the updated row
select current_version, updated_date, ... from table where id = :id
(the current_version, updated_date are resultbinding to update some of the entity's properties).
Can someone give me an example of how I can do this when working with oracle?
I need the command text to be a sql command and not a stored procedure call because I have dynamic issues which SPs will be a hard time to implement.
Thanks in advance,
Ido.
When working with sql server we had a function mapping for the update with a commandtext section that contained a sql statement that does the update/insert and afterwards another select statement for the resultbinding, for example:
-- insert row to history table
insert into ... select ...
-- update the row
update table set ...
-- get the results for the updated row
select current_version, updated_date, ... from table where id = :id
(the current_version, updated_date are resultbinding to update some of the entity's properties).
Can someone give me an example of how I can do this when working with oracle?
I need the command text to be a sql command and not a stored procedure call because I have dynamic issues which SPs will be a hard time to implement.
Thanks in advance,
Ido.