我有一个关于使用游标的问题。
Table t1 having "t1c1" and "t1c2" columns.
Table t2 having "t2c2" and "t2c2" columns.
Table t3 having "t3c2","t3c2","t3c3","t3c4" columns.
Two cursors "cur1" and "cur2".
我编写了需要使用光标“cur1”的for循环将值插入t3的代码
例子:
DECLARE
CURSOR cur1 IS
SELECT t1c1 FROM t1;
CURSOR cur2 IS
SELECT t2c1 FROM t2;
BEGIN
FOR f1 IN cur1 LOOP
EXIT WHEN cur1%NOTFOUND;
INSERT INTO TABLE t3
(
SELECT f1.t1c1,t2.t2c2,'hello' FROM t2;
);
END LOOP;
从上面的代码中,我插入了表 t3 的第一三列。
我想知道如何将 cur2(光标值)插入表 t3 的第 4 列。