Professional Documents
Culture Documents
INCREMENTAR UN ID
PROCEDURE incrementar_id IS
BEGIN
select max(employees.employee_id)+1
into :employees.employee_id
from employees;
END;
====================================================
CARGAR COMBO-BOX Y SE ASIGNE UN VALOR A CADA ITEM
====================================================
====================================================
====================================================
ASIGNAR UN VALOR POR DEFECTO
1. :EMPLOYEES.EMAIL:='dddd@ddd.com';
2. Esto va en when-create-record
====================================================
CREAR COMBO BOX
select emp.first_name,to_char(emp.employee_id)
from employees emp
2. Proceso
PROCEDURE LLENAR_MANAGER
IS
v_grupo varchar2(50);
BEGIN
v_grupo:=populate_group('MANAGER_LISTA');
if v_grupo<>'0' then
message('No se realizo la consulta de la lista departamentos');
else
populate_list('EMPLOYEES.MANAGER_ID','MANAGER_LISTA');
end if;
END;
3. Llamar en el when-new-form-instance
====================================================
LLAMAR UNA LISTA
PROCEDURE click_lista IS
v_lista boolean;
begin
v_lista:=show_lov('nombre_lista');
END;
====================================================
MULTIEMPRESA
1. Esto va en el when-new-form-instance
DEFAULT_VALUE(null,'GLOBAL.CODIGO_EMP');
If :GLOBAL.CODIGO_EMP is not null then
:global.sumar:=0;
llenar_tpago;
llenar_sucursal;
execute_query;
ELSE
alerta('Debe logearse antes de realizar
cambios');
End If;
if :TU_PASANTIA.EST_ID=3 then
es_visible('TU_PASANTIA.DOC_ID',1); --se habilita
else
es_visible('TU_PASANTIA.DOC_ID',0); --se deshabilita
end if;
BOTON ACEPTAR
commit;
exit_form;
====================================================
BOTON APLICAR
commit;
====================================================
BOTON CANCELAR
exit_form;
====================================================
ALERTAS
begin
if :employees.job_id like 'SA%' then
if :employees.salary > 20000 then
--v_boton:=show_alert('ganar_20000');
alerta('si el empleado es vendedor no puede ganar
mas de 20000');
raise form_trigger_failure;
end if;
if nvl(:employees.commission_pct,0)=0 then
--v_boton2:=show_alert('comision');
alerta('si el empleado es vendedor debe
tener una comision');
raise form_trigger_failure;
end if;
end if;
end;
====================================================
REPORTES
1. Agrupar arriba(Group above): Departamentos y empleados
Select d.department_name,e.last_name,e.salary
from departments d,employees e
where d.department_id=e.department_id
select
e.emp_nombre_comercial,pe.per_nombre,pd.per_nombre,p.pas_du
racion
from tu_pasantia p,tu_estudiante es,tu_docente d,tu_empresa
e,tu_persona pe,tu_persona pd
where pe.per_id=es.est_id
and pd.per_id=d.doc_id
select *
from employees e
where e.department_id=:dno_parameter;