Skip to content

Oracle: unparsable section CREATE OR REPLACE TRIGGER #6568

@aiprat

Description

@aiprat

Search before asking

  • I searched the issues and found no similar issues.

What Happened

CREATE OR REPLACE TRIGGER statement with oracle dialect is unparsable

Expected Behaviour

CREATE OR REPLACE TRIGGER is parsed correctly for oracle

Observed Behaviour

Unparsable section parsing violation is raised.

==== parsing violations ====
L: 1 | P: 1 | PRS | Line 1, Position 1: Found unparsable section: 'CREATE OR REPLACE
| TRIGGER contract_trigg...'
WARNING: Parsing errors found and dialect is set to 'oracle'. Have you configured your dialect correctly?

Syntax tree:
[L: 1, P: 1] |file:
[L: 1, P: 1] | unparsable: !! Expected: "<AnyNumberOf: [<Ref: 'ExecuteFileSegment'>, <Delimited: [<Ref: 'StatementSegment'>]>]>"
[L: 1, P: 1] | word: 'CREATE'
[L: 1, P: 7] | whitespace: ' '
[L: 1, P: 8] | word: 'OR'
[L: 1, P: 10] | whitespace: ' '
[L: 1, P: 11] | word: 'REPLACE'
...

How to reproduce

Run sqlfluff parse --dialect oracle <filename> on file with content

CREATE OR REPLACE TRIGGER contract_trigger
BEFORE INSERT OR UPDATE ON contracts
FOR EACH ROW
/

Dialect

oracle

Version

sqlfluff version
3.3.0

python --version
Python 3.13.1

Configuration

No configuration

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoracle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions