The use of NVL in entity creation

The use of NVL in entity creation

Postby 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
kevin.orcutt@meyertool.com
Hylndr
 
Posts: 3
Joined: Thu 06 Oct 2016 15:26

Re: The use of NVL in entity creation

Postby 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.
Shalex
Devart Team
 
Posts: 7616
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle