declare v_sal ; begin loop v_sal :; dbms_output.put_line(v_sal); ; end loop; end;…
declare v_sal ; begin ) loop v_sal :; dbms_output.put_line(v_sal); end loop; end;…
declare cursor cur_emp is select t.* from scott.emp t; begin for r_emp in cur_emp loop dbms_output.put_line(r_emp.empno || ' ' || r_emp.sal); end loop; end;…
declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_empno scott.emp.empno%type; v_ename scott.emp.ename%type; v_sql ) := 'select t.empno, t.ename from scott.emp t'; begin Open cur_variable For v_sql; Loop fetch cur_variable…
declare v_empno scott.emp.empno%type; v_sal scott.emp.sal%type; ) is select t.empno, t.sal from scott.emp t where t.empno = v_empno; begin ); loop fetch cur_emp into v_empno, v_sal; exit when cur_emp%notfound; dbms_output.put_line(v_empno || ' ' || v…
declare v_empno scott.emp.empno%type; v_sal scott.emp.sal%type; cursor cur_emp is select t.empno, t.sal from scott.emp t; begin open cur_emp; loop fetch cur_emp into v_empno, v_sal; exit when cur_emp%notfound; dbms_output.put_line(v_empno || ' ' || v…
declare v_sal ; begin loop v_sal :; dbms_output.put_line(v_sal); then exit; end if; end loop; end;…
declare v_display ); begin .. loop .. loop dbms_output.put_line(i || ' - ' || j); end loop; end loop; end;…
-- refer: -- http://www.cnblogs.com/gnielee/archive/2009/09/09/1563154.html -- http://www.cnblogs.com/yudy/archive/2012/07/18/2597874.html ); CREATE OR REPLACE FUNCTION splitstr(p_string IN VARCHAR2, p_delimiter IN VARCHAR2 := ',') RETURN ty_str_spli…
declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v_sal ,); v_sql ) := 'select t.ename, t.deptno, t.sal from scott.emp t'; begin Open cur_variable For v_sql; Loop fetch cur_variable InTo v_ename, v_dep…