-- has to be executed as hanal2



--select * from treepar_container where container_id = 145;
--
--update treepar_container
--    set owner = 'rpc_ana2',
--        data_view = 'ht_calpar_data',
--        det_parts_view = 'ht_calpar_parts',
--        split_validation = 0
--    where container_id = 145;
--    
--insert into treepar_access values (145,'HALO');
--insert into treepar_access values (145,'RPC_ANA2');
--insert into treepar_access values (145,'RPC_OPER');



--set define off

declare
  l_id number;
begin


insert into treepar_container(
 container_id , class_name, container_name, shared_library, owner, time_table, vers_table, comment_table, data_view,
data_order_by, det_part_name, split_validation, det_parts_view) 

    values (treepar_container_sequ.nextval,
            'HRich700Trb3Lookup', 'Rich700Trb3Lookup', 'libRich', 'rich_ana2',
            'rich700_trb3lookup', 'rich700_trb3lookup_vers', 'rich_comment', 'ht_rich700_lookup_data',
            'trbnet_address,channel', '&nbsp;', 0, null);

--insert into treepar_access values (treepar_container_sequ.currval,'HALO');
insert into treepar_access values (treepar_container_sequ.currval,'RICH_ANA2');
--insert into treepar_access values (treepar_container_sequ.currval,'RPC_OPER');


  select container_id into l_id
      from treepar_container
      where class_name = 'HRich700Trb3Lookup';
  insert into treepar_context
      values(treepar_container_sequ.nextval,l_id,'Rich700Trb3LookupProduction',
             'HADES_CAVE',1,1,'Default context for RICH TRB3 lookup table');
end;

--set define on
