常见问题1000例Oracle(六)

2014-11-24 09:14:11 · 作者: · 浏览: 21
student1_name out varchar2
)
IS
--student_name:='kevin_xiong';
x number:=1;
Cursor cursor1 is select * from test_gary1 where id=student1_id;
--name varchar2(20);
i number:=0;
student_id test_gary1.id%type;
student_name test_gary1.name%type;
student_password test_gary1.password%type;
student_account test_gary1.account%type;
student_emailaddress test_gary1.emailaddress%type;
student_introduce test_gary1.introduce%type;
begin
open cursor1;
fetch cursor1 into student_id,
student_name,
student_password,
student_account,
student_emailaddress,
student_introduce;
if x>0 then
begin
DBMS_OUTPUT.put_line('holl world!');
DBMS_OUTPUT.put_line('holl baby!');
DBMS_OUTPUT.put_line('hello infosys!');
end;
end if;
/*if cursor1%found then
begin
DBMS_OUTPUT.put_line('======='||'-cursor found-');
end;
end if;
if cursor1%notfound then
begin
DBMS_OUTPUT.put_line('---==----'||'-cursor does not found --');
end;
end if;*/
while cursor1%found LOOP
begin
--DBMS_OUTPUT.enable(500000);
DBMS_OUTPUT.put_line('----------');
DBMS_OUTPUT.put_line(student_id);
DBMS_OUTPUT.put_line(student_name);
DBMS_OUTPUT.put_line(student_password);
DBMS_OUTPUT.put_line(student_account);
DBMS_OUTPUT.put_line(student_emailaddress);
DBMS_OUTPUT.put_line(student_introduce);
-- DBMS_OUTPUT.put_line(i);
-- i:=i+1;
fetch cursor1 into student_id,
student_name,
student_password,
student_account,