Reputation: 479
I have to display a select list for years ranging from 2020-2060.
The problem is if i try writing a simple sql using level/rownum it won't take it.
Is there any other way to display the numbers in the range that would then display in the lov?
Upvotes: 0
Views: 848
Reputation: 142705
In Apex, LOV requires two values: display and return. Therefore, you'd
SQL> select 2020 + level - 1 as display_value,
2 2020 + level - 1 as return_value
3 from dual
4 connect by level <= 2060 - 2020 + 1
5 order by 1;
DISPLAY_VALUE RETURN_VALUE
------------- ------------
2020 2020
2021 2021
2022 2022
2023 2023
<snip>
2058 2058
2059 2059
2060 2060
41 rows selected.
So, there's no problem.
Upvotes: 2