sql - Oracle nullable and non nullable column in a view -


i have table in oracle. table has amongst others: employee_id (number, nullable, number of nulls 0) , employee_number (varchar2, nullable, number of nulls 0).

now create view on table:

create or replace force view apps.xxke_l2e_employee (    person_id,    employee_number,    ... )    select employee_id,           employee_number,           ...      xxke.xxke_employees e           inner join xxke.xxke_organizations o on e.organization_id = o.organization_id           inner join xxke.xxke_operating_units ou on e.org_id = ou.org_id;  alter view apps.xxke_l2e_employee add constraint xxke_l2e_employee_v_pk primary key(person_id) disable; 

how on earth possible in view person_id becomes nullable (even when using nvl trick), employee_number not nullable

question: how can make oracle create view in way, person_id column becomes not nullable in view? or how can make wcf odata service query view. after updating edmx file following:

errors: oracle.ssdl(227,6) : error 0075: key part: 'person_id' type xxke_l2e_employee not valid. parts of key must non nullable.

the reason why becomes nullable when creating view query used nvl on employee_id. employee not nullable in query why not. in view, oracle makes resulting column nullable. views not static query. if want not have issue can create materialized view of table nvl pre applied in query query not have null possible selected. can indexes , queries faster.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -