The document creates views and tables to store and filter contract data. It creates a view to select reference numbers from a contracts table. It then inserts, updates, and deletes from this view. Another view is created to join the contracts and clauses tables and count clauses by signature and reference. The contracts table is altered to add an owner column. The contracts view is recreated to filter by the owner column. A privileges table is created to store user privilege levels. A final clauses view is created to filter clauses by the contracts view references and user privilege levels.
The document creates views and tables to store and filter contract data. It creates a view to select reference numbers from a contracts table. It then inserts, updates, and deletes from this view. Another view is created to join the contracts and clauses tables and count clauses by signature and reference. The contracts table is altered to add an owner column. The contracts view is recreated to filter by the owner column. A privileges table is created to store user privilege levels. A final clauses view is created to filter clauses by the contracts view references and user privilege levels.
The document creates views and tables to store and filter contract data. It creates a view to select reference numbers from a contracts table. It then inserts, updates, and deletes from this view. Another view is created to join the contracts and clauses tables and count clauses by signature and reference. The contracts table is altered to add an owner column. The contracts view is recreated to filter by the owner column. A privileges table is created to store user privilege levels. A final clauses view is created to filter clauses by the contracts view references and user privilege levels.
select * from ref_contracts1; update ref_contracts1 set referenc='ref3' where referenc='ref46'; delete from ref_contracts1 where referenc='ref3';
create or replace view contracts1 as
( select Signature,referenc,count('x') cuenta from contracts_ALL1 JOIN clauses_ALL1 using (referenc) group by (Signature,referenc) ) WITH READ ONLY;
ALTER TABLE contracts_ALL1 ADD ( owner varchar2(20));
create or replace view contracts1 as
( select Signature,referenc,count('x') cuenta from (select * from contracts_ALL1 where owner=USER) JOIN clauses_ALL1 using (referenc) group by Signature,referenc ) WITH CHECK OPTION;
( select * from clauses_ALL1 where referenc in (select referenc from contracts1) and exists (select * from privs1 where privacy_lvl <= security_lvl) ) WITH CHECK OPTION;