Skip to content

Split does not work properly #692

Open

Description

@corncat-liu

The split does not work properly for the below Oracle Stored procedure

CREATE OR REPLACE EDITIONABLE PROCEDURE "OWB_ADMIN"."AZBJ_RI_LIMIT_PROC"
AS
week_date_first DATE := TRUNC (azbj_pme_api.opus_date - 7);
week_date_last DATE := TRUNC (azbj_pme_api.opus_date - 1);
BEGIN
logtrace ('LOG',
10001,
'PROC AZBJ_RI_LIMIT_PROC STARTED',
'AZBJ_RI_LIMIT_PROC');
BEGIN
EXECUTE IMMEDIATE ('DROP TABLE STG_RI_LIMIT_DATA PURGE');
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
END;

Screen Shot 2022-11-26 at 8 33 56 PM

Activity

  1. added this to the 0.4.4 milestone on Dec 30, 2022
  2. andialbrecht commented on Dec 30, 2022

    @andialbrecht
    Owner

    Here's a simplified version of the same bug taken from the Oracle reference:

    >>> sql = """CREATE PROCEDURE remove_emp (employee_id NUMBER) AS
    ...    tot_emps NUMBER;
    ...    BEGIN
    ...       DELETE FROM employees
    ...       WHERE employees.employee_id = remove_emp.employee_id;
    ...    tot_emps := tot_emps - 1;
    ...    END;"""
    >>>
    >>> len(sqlparse.split(sql))
    4
    >>> sqlparse.split(sql)
    ['CREATE PROCEDURE remove_emp (employee_id NUMBER) AS\n   tot_emps NUMBER;',
     'BEGIN\n      DELETE FROM employees\n      WHERE employees.employee_id = remove_emp.employee_id;',
     'tot_emps := tot_emps - 1;',
     'END;']
    >>>
    
  3. modified the milestones: 0.4.4, on Mar 20, 2023
  4. modified the milestones: , 0.5.0 on Aug 6, 2023
  5. removed this from the 0.5.0 milestone on Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions