update 쿼리 트랜잭션 안쓰고 실행
pages:
- path: pages/8MwfvW
title: actions update 쿼리 실행
blocks:
- type: query
resource: mysql.qa
sqlType: select
sql: >
SELECT id FROM stock_wine WHERE id > 10 ORDER BY id ASC LIMIT 5
selectOptions:
enabled: true
actions:
- label: 승인
name: 승인
type: query
resource: mysql.qa
confirmText: 승인하시겠어요?
sqlType: update
sql: >
UPDATE stock_wine SET unit = 3 WHERE id = :id;
UPDATE stock_wine SET unit = 3 WHERE id = 1 + :id;
params:
- key: id
valueFromSelectedRows: id
actions sql transaction
만약에 실패하는경우 롤백됩니다. (꼭 커밋을 해야합니다.)
sql: >
START TRANSACTION;
UPDATE stock_wine SET unit = 5 WHERE id = :id;
UPDATE stock_wine SET unit = 5 WHERE id = 1 + :id;
COMMIT;