declare
Type t_emp is record(deptno employees.departmentid%type,
fname employees.firstname%type,
sal employees.salary%type);
v_emp t_emp;
begin
select departmentid, firstname, salary
into v_emp
from employees
where employeeid = 109;
dbms_output.put_line(v_emp.deptno || ' ' || v_emp.fname || ' ' ||
v_emp.sal);
end;
Type t_emp is record(deptno employees.departmentid%type,
fname employees.firstname%type,
sal employees.salary%type);
v_emp t_emp;
begin
select departmentid, firstname, salary
into v_emp
from employees
where employeeid = 109;
dbms_output.put_line(v_emp.deptno || ' ' || v_emp.fname || ' ' ||
v_emp.sal);
end;
本文详细介绍了如何使用SQL语句从数据库中查询特定部门员工信息,并通过DBMS_OUTPUT进行输出的过程,包括变量声明、查询语句及结果展示。
241

被折叠的 条评论
为什么被折叠?



