PL/SQL編程—函數
阿新 • • 發佈:2017-06-29
必須 var turn clas created cti weight num 開頭
SQL> select * from mytest; ID NAME PASSWD SALARY ----- -------------------- -------------------- -------------------------------------------------------------------------------- 1 gagaga 123函數必須要有返回值的在函數的開頭 return 返回類型 is 返回變量名 具體類型 在begin操作完數據後在把對應的變量進行返回 return 返回變量名100 2 gaodingle!!!! 123 100 3 gagaga 123 100SQL> SQL> create function annual_calsaly(id_in varchar2) 2 return 3 number is calsaly number(7,2); 4 begin 5 select salary*12 into calsaly from mytest where id =id_in; 6 return calsaly; 7 end; 8 / Function created SQL> var abc number; SQL> call annual_calsaly(‘1‘)into:abc; Method called abc --------- 1200
PL/SQL編程—函數