Oracle 學習筆記之包的使用

來源:互聯網
上載者:User

Oracle 學習筆記之包的使用,利用程式包可以使得函數和預存程序更加清晰,同時,在調用這些函數和預存程序的時候必須加上包名哦...

  1. /**  
  2.  包的建立和使用  
  3.           文法:  
  4.               create or replace package pkg_name as  
  5.               var_name datetype;  
  6.               function fun_name(..args) return datatype;  
  7.               procdure proc_name(...args) ;  
  8.               end pkg_name;  
  9. **/  
  10.   
  11. create or replace package emp_package as  
  12.   function getStudent(student_id varchar2) return varchar2;  
  13.   procedure getEmps(pageNo integer,pageSize integer,p_count integer);  
  14. end emp_package;  
  15.   
  16. /**  
  17. 實現包的聲明  
  18. */  
  19.   
  20. create or replace package body pkd_emp as  
  21. function getStudent(student_id varchar2) return varchar2 is  
  22. begin  
  23.   --聲明變數   
  24.   begin  
  25.          --函數主體部分   
  26.   end;  
  27. end getStudent; 

相關文章

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.