declare r_emp scott.emp%rowtype; cursor cur_emp is select t.* from scott.emp t; begin open cur_emp; loop fetch cur_emp into r_emp; exit when cur_emp%notfound; dbms_output.put_line(r_emp.empno || ' ' || r_emp.sal); end loop; close cur_emp; end;
The below plsql program unit could be used in a WHEN-NEW-FORM-INSTANCE trigger to initially populate the hierarchical tree with data in Oracle forms.DECLAREhtree ITEM;v_ignore NUMBER;rg_emps RECORDGROUP;BEGIN-- Find the tree itself.htree := Find_Item
--触发器 drop table emp_log create table emp_log( empno number, log_date date, new_salary number, action ) --动作记录 ); create or replace trigger log_sal_adj after update of sal on emp --指定当update执行后,监控对emp表sal列的更改 before or adter for each row --每update一行执