/*
Allow OWB_TST to select from SCOTT tables
grant select on emp to PUBLIC;
grant select on dept to PUBLIC;
grant select on salgrade to PUBLIC;

as oracle
cd ~; cp /mnt/hgfs/installables/psoug_data/payroll_* .
*/
--select object_name, object_type from user_objects order by object_name;

--select object_name, object_type  from user_objects where object_name like '%DIM_SEQ' order by object_name;

--select employee_dim_seq.nextval from dual;

--select object_name, object_type from user_objects where object_name like '%DIM' order by object_name;


--describe employee_dim;

--describe payroll_expenditures_cube;

--select * from user_constraints where table_name like '%_CUBE';

--select * from user_objects where object_name like 'LOAD_%' ;

--select count(*) from scott.emp;

--select * from employee_dim;

/* Category by Grade formula
CASE
WHEN  INGRP1.GRADE  >= 4 THEN 'Top'
ELSE  'Bottom'
END
*/

--select * from scott.salgrade;

--select * from salary_dim;

/* register PAYROLL_L to /home/oracle/ */
/* to_date( INGRP1.PAYROLL_DATE , 'MM/DD/YYYY') */

--describe pay_data_stg;

select * from pay_data_stg;
--select  * from pay_detail_stg;

--select * from time_dim;
--select max(payrollamount) from pay_detail_stg;
--select * from payroll_expenditures_cube;
/*
delete from payroll_expenditures_cube;
commit;
delete from time_dim;
delete from employee_dim;
delete from salary_dim;
delete from pay_detail_stg;
delete from pay_data_stg;
commit;
*/

