当前位置:网站首页> Oracle中dbms_output.put_line的用法实例
Oracle中dbms_output.put_line的用法实例
2022-06-22 17:06:00 【1024问】
1、enable:
2、disable:
3、put:
4、put_line:
5、new_line:
6、get_line(value, index):
7、get_lines(array, index):
总结
dbms_output.put_line的用法
涉及到的知识点如下:
1、enable:在serveroutput on的情况下,用来使dbms_output生效(默认即打开)
set serveroutput on --将output 服务打开2、disable:在serveroutput on的情况下,用来使dbms_output失效
set serveroutput off --将output 服务关闭
将内容写到内存,等到put_line时一起输出,new_line的时候也可以输出。
begin dbms_output.put_line('hello world1111111'); dbms_output.new_line(); dbms_output.put('Hello, Lao An '); dbms_output.put('Hello, Lao An '); dbms_output.new_line(); dbms_output.put_line('Hello, Lao An ');end;/输出:

不用多说了,输出字符,并刷新buffer,前提是set severoutput on;
exec dbms_output.put_line('hello world1111111');
作为一行的结束,可以理解为写入buffer时的换行符
set serveroutput onbegin dbms_output.put_line('hello world1111111'); dbms_output.put('Hello, Lao An'); dbms_output.new_line(); dbms_output.put_line('Hello, Lao An');end;/
这里运用了begin+/来执行PL/SQL过程,我解释一下oracle中斜杠(/)的含义
斜杠就是让服务器执行前面所写的sql脚本。如果是普通的select语句,一个分号,就可以执行了。但是如果是存储过程,那么遇到分号,就不能马上执行了。这个时候,就需要通过斜杠(/)来执行。

获取缓冲区的单行信息。
注:使用get_line时不能用put_line输出,因为put_line之后会将buffer清空。(当然在serveroutput off的情况下put_line是不影响buffer的)。
7、get_lines(array, index):以数组形式来获取缓冲区的多行信息
declare v_data dbms_output.chararr; --先声明局部变量 v_numlines number; begin --enable the buffer first. dbms_output.enable(1000000); --设置缓冲区的大小 dbms_output.put_line('line one'); dbms_output.put_line('line two'); dbms_output.put_line('line three'); v_numlines := 3; dbms_output.get_lines(v_data, v_numlines); --array, index for v_counter in 1..v_numlines loop dbms_output.put_line(v_data(v_counter)); end loop; end; /输出:

到此这篇关于Oracle中dbms_output.put_line用法的文章就介绍到这了,更多相关Oracle dbms_output.put_line用法内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- 请问一下flink mysql-cdc 如何保证server_id全局唯一呢?
- You guys, the first time you used flick MySQL CDC, now the program starts without error, and the new data is not printed out
- 基于转换器 (MMC) 技术和电压源转换器 (VSC) 的高压直流 (HVDC) 模型(Matlab&Simulink实现)
- 巴比特 | 元宇宙每日必读:传腾讯成立XR部门,元宇宙板块再次上涨,多家券商发报告关注虚拟人的投资机会...
- When do project managers particularly want to escape from work?
- 诺亚财富拟登陆港交所:第一季度业绩大幅下滑,曾踩雷“承兴案”
- Quartus prime 18.0 software installation package and installation tutorial
- Stop automatically after MySQL server starts
- 炒股开户选择哪个券商公司是最安全最好呢
- Short video live broadcast source code, use of EditText input box
猜你喜欢

imx6ull的GPIO操作方法
传输层 知识点总结

< JVM part I: memory and garbage collection part > 08 object instantiation and direct memory

@Lucky user of "Qilu Duojiao", Shandong 5A scenic spot calls you to visit the park for free!

Tasks and responsibilities of the test team and basic concepts of testing

Pytorch——报错解决:“torch/optim/adamw.py” beta1, UnboundLocalError: local variable ‘beta1‘

Come to Xiamen! Online communication quota free registration

诺亚财富拟登陆港交所:第一季度业绩大幅下滑,曾踩雷“承兴案”

RSPS2022 Finalist | Dr. Yang Bai 简介

Killed by the script, and "resurrected" by camping
随机推荐
Power BI的五个实用小技巧(文末赠书)
SaaS application development guide
SystemVerilog(十二)-$unit声明空间
Some difficulties in making web pages
Network intelligent operation and maintenance helps improve operation and maintenance efficiency
When do project managers particularly want to escape from work?
【 outils】 utilisation de PIP et de conda
Make it more automatic to transfer slow logs and audit logs of RDS (for MySQL) databases to OBS across spaces
You guys, the first time you used flick MySQL CDC, now the program starts without error, and the new data is not printed out
Huawei cloud "digital intelligence" operation and maintenance
The world's first AR contact lens, the entrance of metauniverse is really opened this time?
A course for New Oriental transformation bilingual live broadcast to bring goods to the project manager
游戏NFT市场:OpenSea最易被切下的蛋糕
问下 cdc 2.2.1监控sqlServer是不支持监控多库的吗?
Configuration of development environment for JSP learning
SOA面向服务的架构
短视频带货源码,保存图片到相册/图库
[learn shell programming easily]-4. The difference between single quotation marks and double quotation marks, the operation of integer values, the definition of arrays in the shell and the detailed us
Filebeat collects log data and transfers it to redis. Different es indexes are created based on log fields through logstash
"Half of Zhejiang's Venture Capital Circle" must be state-owned assets