当前位置:网站首页>Oracle中dbms_output.put_line怎么使用
Oracle中dbms_output.put_line怎么使用
2022-06-23 12:53:00 【亿速云】
Oracle中dbms_output.put_line怎么使用
这篇文章主要介绍“Oracle中dbms_output.put_line怎么使用”,在日常操作中,相信很多人在Oracle中dbms_output.put_line怎么使用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Oracle中dbms_output.put_line怎么使用”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
dbms_output.put_line的用法
涉及到的知识点如下:
1、enable:
在serveroutput on的情况下,用来使dbms_output生效(默认即打开)
set serveroutput on --将output 服务打开
2、disable:
在serveroutput on的情况下,用来使dbms_output失效
set serveroutput off --将output 服务关闭

3、put:
将内容写到内存,等到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;/输出:

4、put_line:
不用多说了,输出字符,并刷新buffer,前提是set severoutput on;
exec dbms_output.put_line('hello world1111111');
5、new_line:
作为一行的结束,可以理解为写入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语句,一个分号,就可以执行了。但是如果是存储过程,那么遇到分号,就不能马上执行了。这个时候,就需要通过斜杠(/)来执行。

6、get_line(value, index):
获取缓冲区的单行信息。
注:使用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怎么使用”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
边栏推荐
- Germancreditdata of dataset: a detailed introduction to the introduction, download and use of germancreditdata dataset
- Synergetic process
- The GLM function of R language uses frequency data to build a binary logistic regression model. The input data for analysis is frequency data, which is transformed into normal sample data (split and s
- What should testers do if the requirements need to be changed when the project is half tested?
- Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181
- Analyse et résolution des défaillances de connexion causées par MySQL utilisant replicationconnection
- 4k-hdmi optical transceiver 1 channel [email protected] Hdmi2.0 optical transceiver HDMI HD video optical transceiver
- Is there any discount for opening an account now? Is it safe to open a mobile account?
- 2-optical-2-electric cascaded optical fiber transceiver Gigabit 2-optical-2-electric optical fiber transceiver Mini embedded industrial mine intrinsic safety optical fiber transceiver
- Hanyuan hi tech 8-way telephone +1-way 100M Ethernet RJ11 telephone optical transceiver 8-way PCM telephone optical transceiver
猜你喜欢

20 years' Shanghai station D question Walker (two points, concise)

C#部分——值类型和引用类型

Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181

First exposure! The only Alibaba cloud native security panorama behind the highest level in the whole domain

Go write file permission WriteFile (filename, data, 0644)?

Hanyuan hi tech 1-channel gigabit optical port to 4-channel Gigabit Ethernet electrical port Gigabit 1-optical 4-electric optical fiber transceiver

20000 words + 30 pictures | MySQL log: what is the use of undo log, redo log and binlog?

Homekit and NFC support: smart Ting smart door lock SL1 only costs 149 yuan

支持HomeKit、NFC:智汀智能门锁SL1仅需要149元

What if the test time is not enough?
随机推荐
R语言dplyr包mutate_all函数将dataframe中的所有数值数值列(变量)乘以某一固定值并生成新的数据列,为新的数据列(变量)指定自定义后缀名称
Esp32-c3 introductory tutorial problem ⑦ - fatal error: ESP_ Bt.h: no such file or directory ESP not found_ bt.h
Germancreditdata of dataset: a detailed introduction to the introduction, download and use of germancreditdata dataset
kubernetes comfig subpath
Hanyuan high tech USB2.0 optical transceiver USB2.0 optical fiber extender USB2.0 optical fiber transmitter USB2.0 interface to optical fiber
Stimulsoft Ultimate Reports 2022.3.1
涉及第三方支付接口,怎么测?
HomeKit支持matter协议,这背后将寓意着什么?
R language dplyr package mutate_ The all function multiplies all numeric columns (variables) in the dataframe by a fixed value to generate a new data column, and specifies a user-defined suffix name f
理财产品长期是几年?新手最好买长期还是短期?
Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181
POW共识机制
< Sicily> 1001. Rails
4E1 PDH optical transceiver 19 inch rack type single fiber transmission 20km E1 interface optical network optical transceiver
Network foundation and framework
Solution: argument type 'string' expected to be an instance of a class or class constrained type
Broadcast level E1 to aes-ebu audio codec E1 to stereo audio XLR codec
R语言使用构建有序多分类逻辑回归模型、ordinal.or.display函数获取有序逻辑回归模型的汇总统计信息(变量对应的优势比及其置信区间、以及假设检验的p值)、汇总统计结果保存到csv
sql增加表记录的重复问题。
R语言glm函数使用频数数据构建二分类logistic回归模型,分析的输入数据为频数数据、将频数数据转化为正常样本数据(拆分、裂变为每个频数对应的样本个数)