Use EF to retrieve the data returned by the database and ef to retrieve the data returned by the database.
Directory
1. Take the custom type returned by the oracle UDF.
1. Take the custom type returned by the oracle UDF. 1. First create a function to return a set of custom types
-- 1. create or replace type UT_BLOCKED_STATISTICS as object (character VARCHAR2 (11), -- character VARCHAR2 (111), character VARCHAR2 (11), THREE_DPT_NME VARCHAR2 (111), CASE_NUM NUMBER, BLOCKED_NUM NUMBER)
-- 2. create or replace type "UT_BLOCKED_STATISTICS_LIST" as table of UT_BLOCKED_STATISTICS;
-- 3. create a UDF and return a set of custom types. Here, the feature bulk collect [batch insert] create or replace function get_BLOCKED_STATISTICS (begintime in date, endtime in date) is used) RETURN response as UT statistics; -- custom type set BEGIN select UT_BLOCKED_STATISTICS (statistics, -- here you need to manually display the values, Three_dpt_cde, Three_dpt_nme, CASE_NUM, BLOCKED_NUM) of the corresponding custom type set) bulk collect into UT from (select two_dpt_cde, two_dpt_nme, Three_dpt_cde, Three_dpt_nme,CASE_NUM,BLOCKED_NUMFrom Mytable where...); return UT; end;
-- 4. here, you can use table () to query the result set returned by the user-defined function. It is as convenient as querying table data as selecting t. * from table (get_BLOCKED_STATISTICS (to_date ('... ', 'yyyy-MM-dd HH24: mi: ss'), to_date (...))) t where ....
2. EF program call
First, create a class field corresponding to the database's custom type UT_BLOCKED_STATISTICS model class BlockedStatistics
Context. Database. SqlQuery <BlockedStatistics> (strSql). ToList () // SQL query string concatenated by strSql // The class created by BlockedStatistics corresponding to the custom type
// EntityFramework. dll v4.0 is used
If the returned custom type is saved, how can I retrieve the returned value in EF ....