The CREATE OR REPLACE the FORCE VIEW MES. V_PP_YIELD
AS
SELECT ROWNUM AS ID,
Lots. MatDati,
Lots. DatiQty,
Defs Dati,
Defs. DefQty
The FROM (SELECT TO_CHAR (lot. MAT_DATE '- DD YYYY - MM) AS MatDati,
The SUM (lot. QTY) AS DatiQty
The FROM MM_LOT lot
GROUP BY TO_CHAR (lot. MAT_DATE '- DD YYYY - MM)) lots
The JOIN
(SELECT TO_CHAR (lot. MAT_DATE '- DD YYYY - MM) AS Dati,
The SUM (defe. DEF_QTY) AS DefQty
The FROM MM_LOT lot, LOT_DEFECT defe
WHERE lot. LOT_NO=defe. LOT_NO
GROUP BY TO_CHAR (lot. MAT_DATE '- DD YYYY - MM)) defs
ON lots. MatDati=defs. Dati;
Results to create a view in every field is empty, as shown in the figure below
Use your table fields of view lot. MAT_DATE is empty, the results because the TO_CHAR function, the use of oracle in view of its corresponding column identification for empty fields
Because now need to use EF in VS imported database model, this requires a view must be not empty fields, so now, so no
Note: ROWNUM column is I'd like to add a not null columns, additional results it has also been identified as can be empty...
Pray god help, how to create the empty fields in Oracle view?
Can be a new method of a non-empty field, can also be modified field is not empty method...
Note: say nothing of the NVL function method, while data can guarantee its not empty, but oracle can still identify it as empty fields
CodePudding user response:
- take a look at this for you have reference value for the
SQL> The create table t1 (c1 int the not null, c2 varchar (10) not null, c3 varchar (10));
The create view v1
As
Select id 100, c1, c2 and c3
The from (select c2, sum (c1) c1, Max (c3) c3 from t1 group by c2);
Desc v1.
Drop the view v1;
Drop table t1;
The Table created.
SQL> SQL> 2, 3, 4,
The View created.
SQL> SQL> The Name of Null? Type
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
ID NUMBER
C1 NUMBER
C2 NOT NULL VARCHAR2 (10)
C3 VARCHAR2 (10)
SQL> SQL>
The View dropped.
SQL>
Table dropped.
SQL>
CodePudding user response: