T_SQL rowtype類型,t_sqlrowtype類型

來源:互聯網
上載者:User

T_SQL rowtype類型,t_sqlrowtype類型

T—SQL格式:

declare

  聲明

begin

處理

end  --完成

 

nvl函數 nvl(string,value);

如果字串不為空白,返回字串

如果字串為空白,返回value

 

下面,輸入一個工號,顯示所有資訊。

declare

sno emp.empno%type;

e1 emp%rowtype;

begin

sno=&no;

select * into e1 from emp where emp.empno=sno;

dbms_output.put_line(e1.empno||' '||e1.ename||' '||e1.job||' '||e1.mgr||' '||e1.hiredate||' '||e1.sal||' '||nvl(e1.comm,0)||' '||e1.deptno);    --列印一個row
exception
when no_data_found then
dbms_output.put_line('not find date');

end

 

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.