简体   繁体   English

Oracle APEX 在 LoV 中返回多个值

[英]Oracle APEX return multiple values in LoV

I have a field as PopUp LOV and as source a shared component with the corresponding code.我有一个作为 PopUp LOV 的字段,并作为具有相应代码的共享组件的源。

    `SELECT u.Lastname || ', ' || u.Firstname AS displayed, i.IUUID
from INTERNAL_SUPERVISORS i
    left outer join USERS u on i.UUID=u.UUID
   
     union
SELECT u2.Lastname || ', ' || u2.Firstname AS displayed, p.PRID
    FROM PROFESSOR p
    left outer join USERS u2 on p.UUID=u2.UUID `

This is my column mapping in the LoV:这是我在 LoV 中的列映射:

I want it to be possible to select a person from the one or from another table and give different IDs as return value depending on the selection.我希望它可以 select 来自一个或另一个表的人,并根据选择提供不同的 ID 作为返回值。

With this implementation it is possible to see and select persons from both tables but when I save the form, I cannot see the User from the professor table but can only see the person from the other table.通过这种实现,可以从两个表中看到 select 人员,但是当我保存表单时,我无法从教授表中看到用户,而只能从另一个表中看到该人。 Is it because of the return value in the column mapping?是因为列映射中的返回值吗? If so is it possible to select two possible return values?如果是这样,是否有可能 select 两个可能的返回值?

I cannot see the User from the professor table我无法从教授表中看到用户

I'd say that it depends on how you're looking at it.我会说这取决于你如何看待它。 If data in a table (you use to store values selected from that LoV) corresponds to two tables, then - when reviewing data - you have to join it to both other tables - internal_supervisors and professor .如果表中的数据(用于存储从该 LoV 中选择的值)对应于两个表,那么 - 在查看数据时 - 您必须将其连接到其他两个表 - internal_supervisorsprofessor

Usually, when designing data model, we use foreign keys to maintain referential integrity.通常,在设计数据 model 时,我们使用外键来保持参照完整性。 As you allow both iuuid and prid to be stored, then it means that you have to check both of those tables while retrieving data.当您允许同时存储iuuidprid时,这意味着您必须在检索数据时检查这两个表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM