PL/SQL parser
(MDEV-10142)
|
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser, Stored routines |
| Affects Version/s: | None |
| Fix Version/s: | 10.3.0 |
| Type: | Technical task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Compatibility | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Sprint: | 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18 | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
Add support for explicit cursor FOR loops when running in sql_mode=ORACLE:
The benefits of this syntax is:
Example:
The fields of the implicitly declared record variable must be updatable:
Internally, the explicit cursor FOR LOOP will be transparently translated to:
So the block in the previous example will be effectively equal to:
|
| Comments |
| Comment by Alexander Barkov [ 2017-01-24 ] | ||||
|
See also: | ||||
| Comment by Alexander Barkov [ 2017-03-10 ] | ||||
|
Pushed to bb-10.2-compatibility | ||||
| Comment by Robert Dyas [ 2018-06-30 ] | ||||
|
Is there any way we can use this particular syntax WITHOUT sql_mode=ORACLE ?
It would be very, very helpful if we could. Even if we had to set a special variable like sql_mode=ALLOW_FOR_IN_LOOP or something. | ||||
| Comment by Alexander Barkov [ 2018-07-03 ] | ||||
|
Yes, FOR loops are possible without sql_mode=ORACLE, but using slightly a different syntax. See |