The use of NVL in entity creation

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 3
Joined: Thu 06 Oct 2016 15:26

The use of NVL in entity creation

Post by Hylndr » Thu 06 Oct 2016 15:42

Howdy All,
First off, I am new to this tool, so bear with me... I am try to convert some existing code that uses good old straight OLE access over to using this ORM tool. In that code some of the queries, used to get the data, are using the NVL function to convert null values to some default...
What is the best path to go about this in the new model??? I have added the table into the model, but do not know how to go about implementing this function on the particular fields/columns... Do I do this in the class properties someplace or in some other place entirely??? I am striving to get the new Entity Framework project as close to the original implementation as possible, so I really need to figure out how to get this in there...

Thanks in advance,

Kevin Orcutt
Meyer Tool, Inc
Senior Software Engineer

Devart Team
Posts: 8083
Joined: Thu 14 Aug 2008 12:44

Re: The use of NVL in entity creation

Post by Shalex » Mon 10 Oct 2016 09:12

We recommend you to implement the following approach basing on the defining query where you can specify any SELECT statement (e.g.: with the NVL function):
1. In Model.Store (Model Explorer) right click on the Tables/Views node > Add > New Defining Query > set Entity Name and specify your SQL Query.
2. Drag&drop entity to the conceptual part of the model (within Model Explorer or on a diagram surface).

The additional steps if you want to map Insert/Update/Delete actions for the entity which has been created:
3. In Model.Store (Model Explorer) right click on the Stored Procedures node > Add > New Command Text - create three insert/update/delete procedures in this way with the needed DML statement in each of them.
4. Right click on the class on the diagram > Stored Procedure Mapping and map Insert/Update/Delete commands to insert/update/delete procedures.

Post Reply