oracle 如何使用 pl/sql 打印字符串而不在末尾附加换行符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7785534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 00:22:38  来源:igfitidea点击:

How to print string using pl/sql without appending the new line character at end

oracleplsqloracle10goracle11g

提问by Tarun

If I use DBMS_OUTPUT.PUT_LINE()method, it always appends a new line character at end.

如果我使用DBMS_OUTPUT.PUT_LINE()方法,它总是在末尾附加一个新行字符。

But what if I want to print lets say Fibonacci series in same line.

但是,如果我想在同一行中打印斐波那契数列呢?

I know the logic of fibonacci...

我知道斐波那契的逻辑...

I just want to know which method would I use to put whole output in same line.

我只想知道我将使用哪种方法将整个输出放在同一行中。

I am using PL/SQL

我正在使用 PL/SQL

回答by cagcowboy

Use DBMS_OUTPUT.PUTinstead of DBMS_OUTPUT.PUT_LINE

使用DBMS_OUTPUT.PUT代替DBMS_OUTPUT.PUT_LINE

回答by Ludovic Kuty

The entry point for all the doc of version 11gR2 is All Books for Oracle Database Online Documentation Library 11g Release 2 (11.2).

版本 11gR2 的所有文档的入口点是Oracle Database Online Documentation Library 11g Release 2 (11.2) 的所有书籍

For other Oracle database versions you might want to start your exploration from Database Documentation. Since version 12.1 the URLs are easier : http://docs.oracle.com/database/121/nav/portal_booklist.htmfor 12.1 and http://docs.oracle.com/database/122/nav/portal_booklist.htmfor 12.2.

对于其他 Oracle 数据库版本,您可能希望从数据库文档开始探索。从 12.1 版开始,URL 更容易:http: //docs.oracle.com/database/121/nav/portal_booklist.htm用于 12.1 和http://docs.oracle.com/database/122/nav/portal_booklist.htm用于12.2.

You might want to check PL/SQL Packages and Types Referencefor that kind of question. In particular the Summary of DBMS_OUTPUT Subprograms. The doc is really handy as a reference when you have questions about the PL/SQL API.

您可能想查看PL/SQL Packages and Types Reference以了解此类问题。特别是 DBMS_OUTPUT 子程序摘要。当您对 PL/SQL API 有疑问时,该文档作为参考非常方便。