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

[FEATURE] missing feature on parsing PL/SQL with "DECLARE" cluase #1786

Open
ZhengguanLi opened this issue May 13, 2023 · 1 comment
Open

Comments

@ZhengguanLi
Copy link

Grammar or Syntax Description

DECLARE clause is not supported yet

SQL Example

  • Simplified Query Example, focusing on the failing feature
    DECLARE 
        num NUMBER; 
    BEGIN 
        num := 10; 
    
        dbms_output.put_line('The number is ' || num); 
    END; 
    
  • Exception
    net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "num" <S_IDENTIFIER>
        at line 2, column 4.
    
    Was expecting one of:
    
        "@"
        "@@"
    

Additional context

The used JSQLParser Version: 4.6
State the applicable RDBMS and version: Oracle 19c
Links to the reference documentation: N/A

@manticore-projects
Copy link
Contributor

Greetings.

Those blocks exceed normal SQL Standard and can become very complex. See the example below.
You will need to provide or sponsor an implementation to get those blocks supported. It will be some serious work.

DECLARE
  l_message  
  VARCHAR2 (100) := 'Hello';
BEGIN
  DECLARE
    l_message2     VARCHAR2 (100) := 
      l_message || ' World!'; 
  BEGIN
    DBMS_OUTPUT.put_line (l_message2);
  END;
EXCEPTION
  WHEN OTHERS
  THEN
    DBMS_OUTPUT.put_line 
   (DBMS_UTILITY.format_error_stack);
END;

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

No branches or pull requests

2 participants