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

E121_FIX #90

Merged
merged 3 commits into from
Aug 29, 2024
Merged

E121_FIX #90

merged 3 commits into from
Aug 29, 2024

Conversation

makssent
Copy link

Fixes #15.

request: CREATE OR ALTER TRIGGER DECCURS1 before update on Company AS DECLARE cursor1 CURSOR for (select id, namecompany, typeproduct from company where typeproduct = 'pc'); BEGIN end
error message: You have an error in your SQL syntax: CREATE OR ALTER TRIGGER DECCURS1 before update on Company AS DECLARE cursor1 CURSOR for (select id namecompany typeproduct from company where typeproduct = 'pc'); BEGIN end no viable alternative at input 'CREATEOR' at line 1 position 8 near @18:9='OR'<98>1:8

new error message:
Can not accept SQL type CreateOrAlterTriggerContext.

Copy link
Collaborator

@TedCraft TedCraft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы немного дополнил код и перенёс реализацию правил для триггера в отдельное правило (к примеру triggerDefinition) за исключением CREATE OR ALTER и сделал бы три правила, одно для CREATE TRIGGER, второе для ALTER TRIGGER, третье для CREATE OR ALTER TRIGGER (что бы не плодить однообразный код)

@makssent
Copy link
Author

Увидел, хорошо

@makssent
Copy link
Author

makssent commented Aug 28, 2024

Исправил, проблема в том, что у нас тестов нету на ALTER TRIGGER и CREATE TRIGGER, сборка проходит, поэтому проблем в парсере с этими командами не должно быть, единственное что по синтаксису могут быть ошибки, если я ошибся и не там запятую поставил или с другим синтаксисом проблемы внутри уже..

@TedCraft TedCraft merged commit 309bef0 into red-soft-ru:master Aug 29, 2024
14 checks passed
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

Successfully merging this pull request may close these issues.

Add E121 Basic cursor support
2 participants