728x90 반응형 개발141 oracle sql 서브쿼리,function,no_data_found,too_many_rows,others ed fn_deptInfocreate or replace function fn_deptInfo(v_name emp.ename%type)return varchar2isv_no number;v_dname varchar2(50);v_loc varchar2(50);v_total varchar2(100);beginselect d.deptno, d.dname, d.loc into v_no, v_dname, v_loc from (select deptno from emp where ename=v_name) e,dept d where d.deptno=e.deptno;v_total := '부서번호:'||v_no ||'부서명:'||v_dname||'장소:'||v_loc;return v_total;end;/----------.. 2015. 10. 7. jsp URLEncoder @특정 값을 보내는 방법1 redirectEncodingTest.jsp---------------------------------------------------------------- ================================================================@특정 값을 보내는 방법 1-1 redirectEncodingTest_sub.jsp----------------------------------------------------------------================================================================ 2015. 10. 6. oracle sql function, dual,upper ed fn_sum2 create or replace function fn_sum2(v_sum1 in number,v_sum2 in number)return numberis v_sum number;beginv_sum :=v_sum1 + v_sum2;return v_sum;end;/@fn_sum2variable sum number;execute :sum :=fn_sum2(10,20)print sum; select fn_sum2(10,20) from dual; --------------------------------------ed sum_dept; create or replace function sum_dept(v_deptno in dept.deptno%type)return number isv_sum num.. 2015. 10. 6. oracle sql cursor update,delete, 무결성 제약조건 create table dept_no(dept_no number);declarecursor dept_cursor is select *from dept;beginfor dept_record in dept_cursor loopinsert into dept_no(deptno) values(dept_record.deptno);end loop;end;/ 2.emp테이블로 커서를 만든 후 테이블 내용을 출력한다. set serveroutput ondeclarecursor emp_cursor1 is select * from emp;beginfor emp_record in emp_cursor1 loopdbms_output.put_line(emp_record.ename||','||emp_record.job);end lo.. 2015. 10. 6. 이전 1 ··· 23 24 25 26 27 28 29 ··· 36 다음 728x90 반응형