云数据库 GAUSSDB-START TRANSACTION:示例

时间:2024-11-02 18:48:31

示例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
--以默认方式启动事务。
openGauss=# START TRANSACTION;
openGauss=# SELECT * FROM tpcds.reason;
openGauss=# END;

--以默认方式启动事务。
openGauss=# BEGIN;
openGauss=# SELECT * FROM tpcds.reason;
openGauss=# END;

--以隔离级别为READ COMMITTED,读/写方式启动事务。
openGauss=# START TRANSACTION ISOLATION LEVEL READ COMMITTED READ WRITE;
openGauss=# SELECT * FROM tpcds.reason;
openGauss=# COMMIT;
support.huaweicloud.com/distributed-devg-v2-gaussdb/gaussdb_v5r2c10_0611.html