etc
PLSQL 커서, 프로시저
DingCoDing
2022. 12. 28. 00:21
반응형
select * from emp
-- 커서 사용
declare
empno number;
ename varchar2(100);
cursor rec_cur is select EMPNO, ENAME from emp;
begin
open rec_cur;
dbms_output.put_line('test');
loop
fetch rec_cur into empno, ename;
exit when rec_cur %NOTFOUND;
dbms_output.put_line(empno||' '||ename);
end loop;
close rec_cur;
end;
create table university1(
university varchar2(100),
department varchar2(100),
student_cnt number
);
select * from university1;
desc university1;
-- 프로시저 사용
create or replace procedure ex_proc
(
p_department in varchar2,
p_student_cnt in number
)
is
p_university varchar2(100) := 'seoul';
begin
insert into
end ex_proc;
반응형