1
votes

I have a tabular form based on a table - link . One of the columns in the tabular form is a select list which is based on the following query:

 select head,code 
 from chart

However, if the table link already contains column value of code from table chart, then the select list should not list that item.

When I do this with not exist keyword, it replaces existing records in link column with the select list query which is probably not in the table link.

Is it possible to do that?

2

2 Answers

1
votes

Updated based on requirements.

In your tabular form query, have a case statement for the select list as follows:

SELECT colx,
       coly,
       ...
       case when code is not null then code 
            else APEX_ITEM.SELECT_LIST_FROM_QUERY(1, code, 'SELECT head, code FROM chart', ,'YES', null)
       end AS code
FROM link

This will display the original code if the field is not null, else will display the select list of values from the chart table.

0
votes

am not exactly understand your question. HOPE IT WILL HELP YOU

select head,code from chart WHERE NOT EXIST (SELECT code  from link);