TYPE t_project_financial_table IS TABLE OF project_financial%ROWTYPE;
g_project_financial_table t_project_financial_table;
表 project_financial 有 15 列。select 语句返回 2 列。我可以批量收集到集合 g_project_financial_table 的 2 个特定列中并将其他列保留为空,还是我必须批量收集到 2 个可变数组(对于每列)并循环遍历这些以将 2 列的值放入集合 g_project_financial_table 中。
像 BULK COLLECT INTO g_project_financial_table.column3, g_project_financial_table.column8 这样的东西?
SELECT k.tag,
(SELECT pa.available
FROM pers_account pa
WHERE pa.valid_from =
(SELECT MAX(pa2.valid_from)
FROM pers_account pa2
WHERE pa2.valid_from <= k.tag)) AS available
BULK COLLECT INTO g_project_financial_table ???????
FROM kalender k
WHERE k.tag BETWEEN to_date('20120430','YYYYMMDD')
AND to_date('20120504','YYYYMMDD')
AND k.ist_werktag = 1
ORDER BY k.tag;