Apex_Collections - 如何循环通过数组的顶点集合 [英] Apex_Collections - How do I loop through an apex collection of arrays

查看:262
本文介绍了Apex_Collections - 如何循环通过数组的顶点集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数组的集合,目前代码

I have a collection of array's, currently the code

select apex_collections.c001 from apex_collections where collection_name = 'LOAD_CONTENT'

在屏幕上显示以下内容。

Shows the below on screen.


C001

570

571

我有一个名为errorTable的表,它有一个与C001数组中包含的值匹配的Table1ID列。我需要显示errorTable中的所有记录给有匹配的用户。在这个例子中,我想显示errorTable中的所有记录,其中Table1ID匹配'570'或'571'。

I have another table called errorTable that has a column Table1ID that matches with the values contained within the C001 array. I need to display all the records within the errorTable to the user where there is a match. In this example I want to show all records in errorTable where Table1ID match '570' or '571'.

我想我需要做一个循环通过apex_collections C001数组,然后做类似select * from errorTable where apex_collections.c001(i)= errorTable.Table1ID

I'm thinking I need to do a loop through the apex_collections C001 array and then do something like select * from errorTable where apex_collections.c001(i) = errorTable.Table1ID

我想获得关于如何写这个循环的帮助

I'm trying to get help on how to write this loop as I'm struggling a bit with that.

推荐答案

创建一个新的区域。类型:PL / SQL动态内容。

Create a new region. Type: "PL/SQL Dynamic Content".

在PL / SQL代码的部分。请输入:

In the part for "PL/SQL Code". Put in something like:

begin
    htp.prn ('<b>Rows with errors:</b><br><br>');

    for i in (select errortable.*
                from errortable, apex_collections
               where apex_collections.c001 (i) = errortable.table1id 
                and apex_collections.collection_name = 'LOAD_CONTENT') loop
        htp.prn (i.column1 || '<br>');
    end loop;
end;

此连接确保只显示来自 apex_collections 的记录匹配条目 errortable

This join makes sure that only records from apex_collections are shown that have a matching entry in errortable

您也可以简单地创建报告区域(经典/交互式),并将SQL用作源:

You can also simply create a report region (classic/interactive) and use the SQL as source:

select errortable.*
  from errortable, apex_collections
 where apex_collections.c001 (i) = errortable.table1id 
  and apex_collections.collection_name = 'LOAD_CONTENT'

这篇关于Apex_Collections - 如何循环通过数组的顶点集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆