存储过程语句

//简单存储过程的例子
//每调用一次打印一次hello world
create or replace procedure  sayhelloworld
as
begin
dbms_output.put_line('Hello world');
end;

 

sqlplus 下测试存储过程

Microsoft Windows [版本 10.0.14393]
(c) 2016 Microsoft Corporation。保留所有权利。

C:\Users\wd>sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 19 15:48:18 2017

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Enter user-name: system
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set serveroutput on //打开屏幕输出开关 需要打印字符串
SQL> execute sayhelloworld();
Hello world

PL/SQL procedure successfully completed.

SQL>

 

相关文章:

  • 2022-12-23
  • 2021-04-28
  • 2021-05-02
  • 2022-02-07
  • 2022-02-07
  • 2022-01-27
  • 2022-01-26
  • 2021-07-22
猜你喜欢
  • 2021-12-09
  • 2021-06-12
  • 2021-10-03
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案