| Start |
|---|
| Assignments model in PL/SQL All programming languages allow us to assign values to variables. Usually, a value is assigned to variable, standing on left side. The prototype of the overall assignment operations in any contemporary programming language looks like this: This will assign right operand to the left operand. In PL/SQL this operation looks like this: Left operand must be always a variable. Right operand can be value, variable or function: When the code block is executed in SQL*Plus the following output is printed in console: There is a feature in PL/SQL that allow us to assign "from right to the left". It's possible to do in SELECT INTO statement. Prototype of this instrunction you will find below: This code will assign character literal to a local variable: When the code block is executed in SQL*Plus the following output is printed in console: Asignment "from right to the left" is not a standard, but it's valuable feature for programmers and users. Generally it's used when programmer is using cursors in PL/SQL - this technique is used, when we want to return a single scalar value or set of columns in the one line of cursor from SQL cursor. Further Reading: |
Read Article
https://develop.horje.com/learn/1434/reference