问题
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:
variableName := variableName + 1;
回答1:
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.
来源:https://stackoverflow.com/questions/28606855/increment-function-in-plsql