Com And Hosting

In this example I will show how to set link column and exclude some columns depending on their value. Suppose I want to link only those records who got active status or so on. You can do it using inbuild column link in Application express 3.2.0 however custom sql query can be implemented in earlier version of APEX.

Here is my sql query to exclude all the fields that contain B and D. For any other values it will display link and send to the specific page for fetch form.

select com_id,
case when company='B' then
    company
case when company='D' then
    company
else
    '{a href="f?p=&APP_ID.:6:&SESSION.::&DEBUG.::P6_COM_ID:'||COM_ID||'"}' || COMPANY ||''
end
as company,
expenses, profit
from table_name

In this case I am sending the user to page 6 and setting the value of P6_COM_ID to fetch the form. This is the primary key to fetch the form.

Hope this help. Reference to this post could be found in Oracle Application Express –

OTN Forum

3 thought on “SQL query to link report column depending on value”

Leave a Reply

Your email address will not be published. Required fields are marked *