why clear_list not clear the list in oracle form

here is my sample code.....please check what is wrong in this code why clear_list not clear the list before updating the list for second selection from drop-down....

DECLARE

   CURSOR CUR_FURNACE_CAT_TYPE(F_TYPE IN CHAR) IS
   
   SELECT FURNACE_TYPE,CAT_TYPE_DESC,CAT_TYPE_ID
   from PRC_FURNACE_CAT_TYPE
   WHERE FURNACE_TYPE=F_TYPE
   order by  CAT_TYPE_ID;
   
   V_CNT NUMBER := 1;

BEGIN
    CLEAR_LIST('PRC_HT_FURNACE.CATEGORY');

       IF :PRC_HT_FURNACE.FURNACE_TYPE='04' THEN  
     
              FOR LP IN CUR_FURNACE_CAT_TYPE('04') LOOP    
                    
                                  ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                  V_CNT := V_CNT + 1;
                                 
              END LOOP;
     
       ELSIF :PRC_HT_FURNACE.FURNACE_TYPE='05'  THEN  
                                               
              FOR LP IN CUR_FURNACE_CAT_TYPE('05') LOOP          
                    
                                  ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                  V_CNT := V_CNT + 1;
                                  
              END LOOP;
           
        ELSIF :PRC_HT_FURNACE.FURNACE_TYPE='06'  THEN  
                                               
              FOR LP IN CUR_FURNACE_CAT_TYPE('06') LOOP
                    
                                  ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                  V_CNT := V_CNT + 1;
                                  
          END LOOP;                                    
        END IF;

 END;
ash sAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helena Markováprogrammer-analystCommented:
Where (in what trigger) is the provided code used ?  Also you have to read Clear_list built-in in the Forms on-line help for usage notes and restriction.
0
ash sAuthor Commented:
in when_list_changed trigger i used that code....
0
ash sAuthor Commented:
that is Drop down list 2 which depends on the value that it is selected in Drop down list 1

somehow on list changed of Drop down list 1 i want the Drop down list 2 to be filtered.

i write drop down list 1 code in when new form instance......and drop down list 2 code in when_list_changed trigger.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ash sAuthor Commented:
supposed i have 1st list the
A
B
C

if i select 'A'

then Second list show
 1
2
3
and if i select B in 1 drop-down list
then 2nd list show
3
4
5
0
ash sAuthor Commented:
but in my code problem is that when i select A then it show result
1
2
 3
and when i select B then it show
3
4
5
1
2
3
clear_list not clear the list.
0
Helena Markováprogrammer-analystCommented:
If I understand it correctly there is 1st list - PRC_HT_FURNACE.FURNACE_TYPE and second PRC_HT_FURNACE.CATEGORY. Is there any error ?
Have you try only this code ?

 BEGIN
     CLEAR_LIST('PRC_HT_FURNACE.CATEGORY');
END;
0
ash sAuthor Commented:
yp, u understand correctly.............problem is that clear list not clear the 2 list before updating the 2 list depend on list 1.............
0
ash sAuthor Commented:
i write whole above code(2nd drop down list code) in when_list_changed trigger and 1st drop down list code in when-new-form-instance......
0
Helena Markováprogrammer-analystCommented:
I am lost:
1st list - PRC_HT_FURNACE.FURNACE_TYPE - here is When-List-Changed trigger ?
2nd list - PRC_HT_FURNACE.CATEGORY
0
ash sAuthor Commented:
no............
1st list - PRC_HT_FURNACE.FURNACE_TYPE -------------------code in when_new_form_instance
2nd list - PRC_HT_FURNACE.CATEGORY--------code in When-List-Changed trigger
0
Helena Markováprogrammer-analystCommented:
But When-list-changed trigger is on what item- PRC_HT_FURNACE.FURNACE_TYPE or PRC_HT_FURNACE.CATEGORY ?
0
ash sAuthor Commented:
When-list-changed trigger is on PRC_HT_FURNACE.CATEGORY
0
ash sAuthor Commented:
sorry When-list-changed trigger is on item- PRC_HT_FURNACE.FURNACE_TYPE
0
Helena Markováprogrammer-analystCommented:
So it is the problem, because you cannot clear list item in its when-list-changed trigger.  You can use your code e.g. in When-New-Record-Instance trigger of block PRC_HT_FURNACE and also in When-list-changed trigger on PRC_HT_FURNACE.FURNACE_TYPE.

According to your last post it ought to work. Have you try only clear_list and see what will happen ?
0
ash sAuthor Commented:
i used When-list-changed trigger on PRC_HT_FURNACE.FURNACE_TYPE but it still not clear the list
0
Helena Markováprogrammer-analystCommented:
OK, try only this code

BEGIN
    CLEAR_LIST('PRC_HT_FURNACE.CATEGORY');
END;
0
ash sAuthor Commented:
in which item trigger i used this code?
0
Helena Markováprogrammer-analystCommented:
Please try it on When-List-Changed trigger on item PRC_HT_FURNACE.FURNACE_TYPE.
0
ash sAuthor Commented:
if i only use this code then how i populate the list PRC_HT_FURNACE.CATEGORY....................
0
Helena Markováprogrammer-analystCommented:
For this test you can use this part of your code in the When-New-Form-Instance trigger:
 FOR LP IN CUR_FURNACE_CAT_TYPE('04') LOOP    
                     
                                   ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                   V_CNT := V_CNT + 1;
                                   
               END LOOP;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark GeerlingsDatabase AdministratorCommented:
Have you considered using plain text items with LOVs instead of "list" items in Oracle Forms.  I find these easier to work with as a developer than list items, and more flexible for users (especially for querying).  But maybe you consider this combination to be "old fashioned" and "list items" to be more up-to-date or "user-friendly".  It is true that plain text items and LOVs have been supported in Oracle Forms for at least 30 years, and "list" items have only been supported for about 25 years.
 items
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.