且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在PL/SQL中的内存表中创建和选择?

更新时间:2023-12-01 14:47:46

如上所述,这样做可能没有多大意义,但是您可以使用某种

As said above, it might not have much sense to do so, but you could use some kind of hashmap to do the job for you. This uses associative arrays.

1)在程序的开头填充哈希图

1) populate the hashmap at the beginning of your program

for x in (select out_date, special_id from input_table) loop
   my_hashmap(x.special_id) := x.out_date;
end loop;

2)而不是选择,而是在需要时使用

2) instead of the select, you get the out_date when you need it with a

curr_out_date := my_hashmap(cursor.special_id);

3)享受,希望它可以使plsql对您更友好

3) enjoy, hope it helps make plsql friendlier to you