Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

increment function in plsql

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;
like image 641
nightfox79 Avatar asked Feb 19 '15 12:02

nightfox79


1 Answers

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.

like image 175
Alex Poole Avatar answered Sep 30 '22 07:09

Alex Poole