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

MERGE文をBeautifulStringifierオブジェクトで整形出力するとON句で崩れる #3

Closed
hiro80 opened this issue Nov 25, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@hiro80
Copy link
Owner

hiro80 commented Nov 25, 2018

対策としてMergeStmtのConstraintプロパティをPredicate型からBracketedPredicate型に変更する方法がある。

MERGE INTO 退職社員マスタ T1
USING (SELECT
         S1.社員コード
        ,S1.社員名
        ,S1.年齢
       FROM 社員マスタ S1
       WHERE S1.年齢 >= 30)
ON (
      T1.社員コード = S1.社員コード
    AND 社員コード  = 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WHEN MATCHED THEN
  UPDATE SET
    T1.社員名 = S1.社員名
   ,T1.年齢  = S1.年齢
WHEN NOT MATCHED THEN
  INSERT(
    社員コード
   ,社員名
   ,年齢
  )VALUES(
    S1.社員コード
   ,S1.社員名
   ,S1.年齢
  )
@hiro80 hiro80 added the bug Something isn't working label Nov 25, 2018
@hiro80
Copy link
Owner Author

hiro80 commented Dec 12, 2018

ANTLRの文法定義において、文法の構成要素としてBracketedPredicateを指定できないため、上記の方法は採用しなかった。修正済み。

@hiro80 hiro80 closed this as completed Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant