将 Oracle ApEx 集合连接到实际表

发布于 2024-11-25 02:46:51 字数 327 浏览 1 评论 0原文

在 Oracle ApEx 中,是否可以将模式中的实际表加入到 Oracle ApEx 集合中,因为我在这样做时遇到了困难?

基本上有以下情况:

select c001,  -- employee id from collection
       c002,
       c003   -- employee dept no from collection
from   apex_collections,
       emp
where  emp.id = c001
and    emp.deptno = c003;

以上可能吗还是我遗漏了什么?

Within Oracle ApEx is it possible to join an actual table in your schema to an Oracle ApEx Collection, as I am having trouble doing so?

Basically have the following scenario:

select c001,  -- employee id from collection
       c002,
       c003   -- employee dept no from collection
from   apex_collections,
       emp
where  emp.id = c001
and    emp.deptno = c003;

Is the above possible or am I missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

゛时过境迁 2024-12-02 02:46:51

我们可以将 apex 集合与我们的模式表连接起来..它会起作用..

select c001,  -- employee id from collection
       c002,
       c003   -- employee dept no from collection
from   apex_collections,
       emp emp
where  emp.empno = c001
and    emp.deptno = c003;

we can join apex collection with our schema tables..it will work..

select c001,  -- employee id from collection
       c002,
       c003   -- employee dept no from collection
from   apex_collections,
       emp emp
where  emp.empno = c001
and    emp.deptno = c003;
心碎的声音 2024-12-02 02:46:51
/*
I have this table person (personid, ...., telephone_numbers)
in which the column "telephone numbers" is a nested table.
In the example below I'm trying to use this into collections and display the count of telephone numbers that the row has.
-- */
DECLARE
  telno telephone_number_table; -- variable name and type.
  cnt INTEGER;
BEGIN
  SELECT p.telephone_numbers -- accept the nested table into the variable
    INTO telno
    FROM person p
   WHERE p.personid = 1;

  SELECT COUNT(*) -- I'm using COUNT(*) here, you can use your valid column listing.
    INTO cnt
    FROM person p
    CROSS JOIN TABLE(telno) tel -- use a cross join with alias
   WHERE p.personid = 1;

  dbms_output.put_line(cnt);
END;
/
/*
I have this table person (personid, ...., telephone_numbers)
in which the column "telephone numbers" is a nested table.
In the example below I'm trying to use this into collections and display the count of telephone numbers that the row has.
-- */
DECLARE
  telno telephone_number_table; -- variable name and type.
  cnt INTEGER;
BEGIN
  SELECT p.telephone_numbers -- accept the nested table into the variable
    INTO telno
    FROM person p
   WHERE p.personid = 1;

  SELECT COUNT(*) -- I'm using COUNT(*) here, you can use your valid column listing.
    INTO cnt
    FROM person p
    CROSS JOIN TABLE(telno) tel -- use a cross join with alias
   WHERE p.personid = 1;

  dbms_output.put_line(cnt);
END;
/
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文