plsql习题.docVIP

  • 38
  • 0
  • 约 8页
  • 2016-12-02 发布于河南
  • 举报
plsql习题

使用pl/sql块编程实现,注意必要的异常处理。 1.输入一个员工号,输出该员工的姓名、薪金和工作时间(按年月日显示)。 Set serveroutput on Declare V_ename scott.emp.ename%type; V_sal scott.emp.sal%type; V_hiredate scott.emp. hiredate %type; Begin Select ename, sal, hiredate into v_ename, v_sal, v_hiredate from scott.emp where empno=empno; Dbms_output.put_line(姓名:|| v_ename|| 工资:|| v_sal|| 工资日期:||to_char(v_hiredate,yyyy-mm-dd)); EXCEPTION When no_data_found then Dbms_output.put_line(输入编号有误!); End; / 2.接收一个员工号,输出该员工所在部门的名称。 Set serveroutput on Declare V_dname scott.dept.dname%type; Begin select dname into v_dname from scott.dept a,scott.emp b whe

文档评论(0)

1亿VIP精品文档

相关文档