Skip to content

[FORMATTING] MINUS operator not handled in PLSQL dialect #825

Closed
@srtucker

Description

@srtucker

Input data

Which SQL and options did you provide as input?

SELECT field1,
field2,
field3
FROM table1

MINUS

SELECT field1,
field2,
field3
FROM table2

Expected Output

SELECT
    field1,
    field2,
    field3
FROM
    table1
MINUS
SELECT
    field1,
    field2,
    field3
FROM
    table2

Actual Output

SELECT
    field1,
    field2,
    field3
FROM
    table1 MINUS
SELECT
    field1,
    field2,
    field3
FROM
    table2

Usage

  • How are you calling / using the library? Via sql-formatter-vscode
  • What SQL language(s) does this apply to? PLSQL
  • Which SQL Formatter version are you using? 15.4.9

Possible Fix
Looking at the code I believe the issues is on line 69 of plsql.formatter.ts, reservedSetOperations here should include "MINUS" instead of "EXCEPT" for PLSQL ("EXCEPT" is the equivalent operator for T-SQL).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions