Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Restrict the status in Oracle Apex
Restrict the status in Oracle Apex [message #678819] Thu, 16 January 2020 06:00 Go to next message
petar97
Messages: 120
Registered: October 2018
Senior Member
I have started to learn Oracle Apex, and I follow this document - https://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-spreadsheet-hol-5532109.pdf
I can't understand why on page 27 they use this query

select distinct status d, status r 
      from spreadsheet
      order by 1
They use status twice on one table

Thanks in advance
Re: Restrict the status in Oracle Apex [message #678837 is a reply to message #678819] Fri, 17 January 2020 01:45 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Select list query requires two columns: one is DISPLAY value, another one is RETURN value.

Usually, it is something like

select department_name as display_value,
       department_id   as return_value
from depts
Sometimes, the source table's contents is such that the same column represents both display AND return value - just like in your case. An example might be this:

SQL> with currency (code) as
  2    (select 'EUR'   from dual union all
  3     select 'USD'   from dual union all
  4     select 'GBP'   from dual union all
  5     select 'CHF'   from dual
  6    )
  7  --
  8  -- Apex query would then be
  9  --
 10  select code as display_value,
 11         code as return_value
 12  from currency;

DIS RET
--- ---
EUR EUR
USD USD
GBP GBP
CHF CHF

SQL>
Previous Topic: APEX export/import between 5.1.4 and 5.1.2
Next Topic: Create View Error Message
Goto Forum:
  


Current Time: Thu Mar 28 09:14:27 CDT 2024