oracle plsql中的增量函数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28606855/
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-09 00:45:22  来源:igfitidea点击:

increment function in plsql

oracleplsqloracle11g

提问by nightfox79

In most programming languages you have a fast way to write an increment for a variable like the following examples:

在大多数编程语言中,您有一种快速的方法来为变量编写增量,如下例所示:

inc(variableName);
variableName++;
variableName += 1;

Which ways are there in Oracle Pl/Sql to do this instead of using the following:

Oracle Pl/Sql 中有哪些方法可以做到这一点,而不是使用以下方法:

variableName := variableName + 1;

回答by Alex Poole

The operators are listed in the documentation.

操作员在文档中列出。

There is no equivalent of ++or +=. I'm afraid you have to do it the long way.

没有相当于+++=。恐怕你得走很长的路。

You could write your own inc()function but that would probably make your code less readable to others as it would be non-standard.

您可以编写自己的inc()函数,但这可能会使您的代码对其他人的可读性降低,因为它是非标准的。