游标2用游标1每条记录中的条件查找
游标2用参数实现,其中MyString VARCHAR2(20);是测试用的变量
如下

create or replace procedure cursor_example
as
MyString VARCHAR2(20);

CURSOR SelectContent IS
select A1,A2 from A;

CURSOR SelectContent2(A1String in varchar2) IS
select B1,B2 from B where B.B1=A1String;

begin
  for cursor1 in SelectContent
    loop
      MyString := cursor1.A1;
      for cursor2 in SelectContent2(cursor1.A1)
        loop
           MyString := cursor2.B2;
        END loop;
    END loop;
end cursor_example;

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2022-02-23
  • 2022-02-13
  • 2021-09-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案