云数据库 GAUSSDB-DECLARE:示例

时间:2024-11-13 14:45:54

示例

声明用于查询的游标示例:
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-v8-gaussdb/gaussdb-42-0226.html