Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plisql multi-range in conditional control #186

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

TsinghuaLucky912
Copy link
Contributor

The in condition in the for loop in Oracle's PL/SQL procedure language is list is supported:

ivorysql=# do $$
ivorysql$# declare
ivorysql$#    j int := 10;
ivorysql$# begin
ivorysql$#    for i in 1..3, reverse j+10..j+1 loop
ivorysql$#       raise info '%', i;
ivorysql$#    end loop;
ivorysql$# end; $$ language plisql;
INFO:  1
INFO:  2
INFO:  3
INFO:  20
INFO:  19
INFO:  18
INFO:  17
INFO:  16
INFO:  15
INFO:  14
INFO:  13
INFO:  12
INFO:  11
DO
ivorysql=#

@killerwzb killerwzb requested a review from rasifr January 30, 2023 02:33
@grantzhou
Copy link
Contributor

Thank you @TsinghuaLucky912 for this great attempt! We are having the team review your patch.
Before we go through this, could you please create an issue regarding your PR? The future release notes need to include this feature explanation by referring to this issue.

@TsinghuaLucky912
Copy link
Contributor Author

@grantzhou thank you for your reply

Previous FOR (Integer Variant):

[ <<label>> ]
FOR name IN [ REVERSE ] expression .. expression [ BY expression ] LOOP
    statements
END LOOP [ label ];

Now FOR (Integer Variant):

[ <<label>> ]
FOR name IN condition_iterator [ , condition_iterator ... ] LOOP
    statements
END LOOP [ label ];

condition_iterator:
[ REVERSE ] expression .. expression [ BY expression ]

@grantzhou
Copy link
Contributor

Ok, I created one issue Issue 189 for you.

@grantzhou thank you for your reply

Previous FOR (Integer Variant):

[ <<label>> ]
FOR name IN [ REVERSE ] expression .. expression [ BY expression ] LOOP
    statements
END LOOP [ label ];

Now FOR (Integer Variant):

[ <<label>> ]
FOR name IN condition_iterator [ , condition_iterator ... ] LOOP
    statements
END LOOP [ label ];

condition_iterator:
[ REVERSE ] expression .. expression [ BY expression ]

@TsinghuaLucky912
Copy link
Contributor Author

@grantzhou thank you very much

@grantzhou grantzhou linked an issue Feb 2, 2023 that may be closed by this pull request
@grantzhou grantzhou added the enhancement New feature or request label Feb 2, 2023
@grantzhou grantzhou merged commit 5c10665 into IvorySQL:master Feb 9, 2023
@TsinghuaLucky912 TsinghuaLucky912 deleted the for_in_list branch February 10, 2023 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support plisql multi-range in conditional control
2 participants