Is it possible to use commandtext for function mapping?

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Ido Flatow
Posts: 8
Joined: Tue 21 Apr 2009 07:50

Is it possible to use commandtext for function mapping?

Post by Ido Flatow » 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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 23 Apr 2009 09:31

You can write an anonymous PL/SQL block to the CommandText property of some function and then map this function in the
ModificationFunctionMapping section of the MSL part of your .edmx file.
But in case you want to return values from this function, you need to use something like the workaround we have already sent to you.

Post Reply