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

[Oracle SQL] Enhancing CreateFunction of Oracle by adding several kinds of statement #28625

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

lancelly
Copy link
Contributor

@lancelly lancelly commented Oct 2, 2023

Related issue: #27569
In this pr, I added several kinds of statement for createFunctionStatement of Oracle. I referred to this doc where you can find the detailed definition: https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/block.html#GUID-9ACEB9ED-567E-4E1A-A16A-B8B35214FC9D
截屏2023-10-02 22 34 15

Now the following SQL can be parsed:
"CREATE FUNCTION f(cur SYS_REFCURSOR, mgr_hiredate DATE) RETURN NUMBER IS emp_hiredate DATE; before number :=0; after number:=0; begin loop fetch cur into emp_hiredate; exit when cur%NOTFOUND; if emp_hiredate > mgr_hiredate then after:=after+1; else before:=before+1; end if; end loop; close cur; if before > after then return 1; else return 0; end if; end;
"
截屏2023-10-02 22 36 16
截屏2023-10-02 22 41 22

@lancelly lancelly changed the title Add more statement for createFunction of Oracle [Oracle SQL]Add more statement for createFunction of Oracle Oct 2, 2023
@lancelly lancelly changed the title [Oracle SQL]Add more statement for createFunction of Oracle [Oracle SQL] Add more statement for createFunction of Oracle Oct 2, 2023
@lancelly lancelly changed the title [Oracle SQL] Add more statement for createFunction of Oracle [Oracle SQL] Enhancing CreateFunction of Oracle by adding several kinds of statement Oct 2, 2023
@RaigorJiang RaigorJiang merged commit 1147d58 into apache:master Oct 9, 2023
127 checks passed
@RaigorJiang
Copy link
Contributor

@lancelly Good fix, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants