云数据库 GAUSSDB-DECLARE:示例

时间:2024-11-02 18:50:24

示例

声明用于查询的游标示例:
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/centralized-devg-v3-gaussdb/gaussdb-12-0210.html