declare BEGIN ----你的语句块 EXCEPTION WHEN NO_DATA_FOUND THEN NULL; -- 捕获错误不执行 END; /
declare cursor mycursor1(v_line number,v_page number) is select ename from (select rownum id,emp.ename ename from emp) where id between (v_line*(v_page-1)+1) and v_line*v_page; v_ename emp.ename%type; begin if not mycursor1%isopen then open mycursor1(&行数,&页数); end if; loop fetch mycursor1 into v_ename; exit when mycursor1%notfound; dbms_output.put_line(v_ename); end loop; close mycursor1; exception when NO_DATA_FOUND then dbms_output.put_line('对不起'); end;
这是开始我写的 SQL code
Code highlighting produced by Actipro CodeHighlighter (freeware) http://w
下个Oracle for vista 版本的安装试试 10G和11G的 http://www.oracle.com/technology/software/products/database/index.html ------------------------------------------- ......