-2
DECLARE
   today       DATE;
   yesterday   DATE;
   traffic     NUMBER;

   CURSOR c1
   IS
      SELECT dt, traffic
        FROM traffic_diff;
BEGIN
   OPEN c1;

   FETCH c1
    INTO today, traffic;

   INSERT
   CLOSE c1;
END;
/

请建议如何将值插入表中。在创建光标之前。

4

1 回答 1

0

尝试这个 :-

DECLARE
   today       DATE;
   yesterday   DATE;
   traffic     NUMBER;

   CURSOR c1
   IS
      SELECT dt, traffic
        FROM traffic_diff;
BEGIN

   insert into traffic_diff(dt,traffic) values(val1,val2);
   commit;

   OPEN c1;

   FETCH c1
    INTO today, traffic;

   CLOSE c1;
END;
/
于 2013-02-23T23:20:55.850 回答