plsql中如何一次性将查询语句中的多个值赋给对应的变量

create or replace function "FIND_STUDENT_BYID"(studentId in number)
return varchar2 is
       studentName varchar2(500); --学生姓名
       studentAge number; --学生年龄
begin
     --根据学生id查询对应的学生信息‘
     select s.sname, s.sage into studentName, studentAge from student s where s.sid = studentId;
     --在plsql输出中打印信息
     dbms_output.put_line('学生姓名:'||studentName||'======学生年龄:'||studentAge);
     --返回学生姓名
     return studentName;
end;

猜你喜欢

转载自blog.csdn.net/u010999809/article/details/81511946