# Actions에서 다수의 UPDATE 쿼리를 호출하는 방법

**URL:** https://ask.selectfromuser.com/t/actions-update/213
**Category:** 사용 팁
**Tags:** actions, update
**Created:** [7월 1, 2024, 5:53오전 UTC](https://ask.selectfromuser.com/t/actions-update/213 "2024-07-01T05:53:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hbkim](https://yyz2.discourse-cdn.com/flex032/user_avatar/ask.selectfromuser.com/hbkim/32/23_2.png) [@hbkim](https://ask.selectfromuser.com/u/hbkim)
#### Post date: [7월 1, 2024, 5:53오전 UTC](https://ask.selectfromuser.com/t/actions-update/213/1 "2024-07-01T05:53:53Z")

</div>

**update 쿼리 트랜잭션 안쓰고 실행**

```yaml
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**  
만약에 실패하는경우 롤백됩니다. (꼭 커밋을 해야합니다.)

```yaml
      sql: >
        START TRANSACTION;
        
        UPDATE stock_wine SET unit = 5 WHERE id = :id;
        UPDATE stock_wine SET unit = 5 WHERE id = 1 + :id;
        
        COMMIT;

```
