This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14543|Reply: 2

[Source] Definitions and references to oracle stored procedures

[Copy link]
Posted on 3/20/2015 3:26:58 PM | | |
  1. --存储过程的定义
  2. create procedure proc_test
  3. as
  4. begin
  5.     dbms_output.put_line('我是一个存储过程');
  6. end;

  7. --存储过程的调用
  8. begin
  9.     proc_test;
  10. end;

  11. create or replace procedure
  12. proc_test2(a int,b int,c out int)--引用传递
  13. as
  14. begin
  15.     c := a + b;
  16. end;

  17. declare
  18. n int := 0;
  19. begin
  20.     dbms_output.put_line(n);
  21.     proc_test2(34,65,n);
  22.     dbms_output.put_line(n);
  23. end;

  24. --函数
  25. create or replace function fun_test(a int,b int) return int
  26. as
  27. c int;
  28. begin
  29.     c:= a+b;
  30.     return c;
  31. end;

  32. declare
  33. n int;
  34. begin
  35.     n := fun_test(1,5);
  36.     dbms_output.put_line(n);
  37. end;
Copy code





Previous:SQL Server blocked the process 'sys.sp_OACreate' for the component 'Ole Automation Procedures'...
Next:How to quickly judge whether a website program is a dedecms dreamweaver management system
Posted on 3/20/2015 4:34:15 PM |
                     
Posted on 3/21/2015 2:28:08 AM |
I replied because I could use a playful expression
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com