标签:com style color int c cti rgb sp har t sql
CREATE FUNCTION
annual_income(spNAme VARCHAR2) RETURN
NUMBER IS yearSal
number(7,2);
BEGIN
SELECT (sal+NVL(comm,0))*12 INTO yearSal FROM emp WHERE ename=spNAme;
RETURN yearSal;
END;
/
SQL> var income number;
SQL> call annual_income(‘SMITH‘)
into:income;
SELECT annual_income(ename) from emp;
标签:com style color int c cti rgb sp har t sql
原文地址:http://www.cnblogs.com/nuaa/p/3698051.html