트리거에 여러개의 execute 문을 사용할 수 있는지요?

by 푸르른하늘 posted Oct 13, 2020

* 질문 등록 시 다음의 내용을 꼭 기입하여 주세요.
OS
Window10
CUBRID Ver.
10.2
CUBRID TOOL Ver.
SQLGate 9.9.8.0
응용 환경(API)
java

* CUBRID 응용 오류, SQL 오류 또는 SQL 튜닝 관련된 문의는 반드시 다음의 내용을 추가해 주세요. 비밀글이나 비밀 댓글도 가능합니다.
* 저희가 상황을 이해하고, 재현이 가능해야 알 수 있는 문제들이 많습니다. 가능한 정보/정황들을 부탁합니다.
에러 내용 및 재현 방법 재현 가능한 Source와 SQL
관련 테이블(인덱스, 키정보 포함) 정보 CUBRID 홈 디렉토리 아래 log 디렉토리 압축

-------------- 아래에 질문 사항을 기입해 주세요. ------------------------------------------------------------------------
create trigger tr_tb_authority_insert
after insert on tb_authority
  execute insert into tb_menu_auth (aid, menu_id)
  select a.authority_id aid, m.id menu_id
  from tb_authority a
  join tb_menu_tree m
  where a.authority_id=authority_id and m.menu_depth>0
  order by a.authority_id, m.id;

  if authority_id = 1 
    execute update tb_menu_auth set access_auth=1, read_auth=1, write_auth=1, delete_auth=1 where aid=1;


질문내용입니다. 위 쿼리문은 mysql에서 사용하던 트리거를 큐브리드로 변환한 것입니다.
2번의 execute 문을 처리할 수 없는지요?

Articles

16 17 18 19 20 21 22 23 24 25