查询一次数据库给多个变量赋值

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;

————————————————
版权声明:本文为CSDN博主「罗小树」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010999809/java/article/details/81511946

posted @ 2020-06-10 16:20  bug开发工程师  阅读(509)  评论(0编辑  收藏  举报