云数据库 GAUSSDB-DECLARE:示例

时间:2024-11-01 17:13:33

示例

声明用于查询的游标示例:
EXEC SQL DECLARE C CURSOR FOR SELECT * FROM My_Table; 
EXEC SQL DECLARE C CURSOR FOR SELECT Item1 FROM T; 
EXEC SQL DECLARE cur1 CURSOR FOR SELECT version();
声明用于预备语句的游标示例:
EXEC SQL PREPARE stmt1 AS SELECT version(); 
EXEC SQL DECLARE cur1 CURSOR FOR stmt1;
support.huaweicloud.com/distributed-devg-v8-gaussdb/gaussdb-12-0183.html