Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to change properties with a looping cursor 1

Status
Not open for further replies.

tropics48

Programmer
Jan 8, 2004
5
US
I'm trying to find certain conditions and if they equal those conditions (there may be more than one, which is why I have the loop) I want to change the item properties. It seems to be looping through, but the properties aren't changing for some reason. Can anyone make some suggestions? Thanks!

CURSOR C1P IS
SELECT cdtrans
FROM pd21ptxncode
WHERE nuchange = :b_ctrl_1.nuchange;


BEGIN

OPEN C1P;
LOOP
FETCH C1P
INTO l_cdtrans_s;

IF l_cdtrans_s = 'CHK' THEN
Set_Item_Property (':b_personn.NB_adcityc',Navigable,Property_true);
Set_Item_Property (':b_personn.nb_adcityc',Insert_allowed,Property_true);
Set_Item_Property (':b_personn.nb_adcityc',Update_allowed,Property_true);
Set_Item_Property (':b_personn.nb_adcityc',Visual_attribute,'VA_OPT_ITEM');

Set_Item_Property (':b_personn.adstatec',Navigable,Property_true);
Set_Item_Property (':b_personn.adstatec',Insert_allowed,Property_true);
Set_Item_Property (':b_personn.adstatec',Update_allowed,Property_true);
Set_Item_Property (':b_personn.adstatec',Visual_attribute,'VA_OPT_ITEM');

Exit
WHEN C1P%NOTFOUND;

END LOOP;
Close C1P;

END;
 

1) I do not see: END IF;

2) For each " l_cdtrans_s = 'CHK' " you are setting the SAME properties, if this is what you want then forget the cursor and do this:
Code:
...
  SELECT COUNT(*) FROM pd21ptxncode INTO v_cnt
   WHERE nuchange = :b_ctrl_1.nuchange
     AND  cdtrans = 'CHK';
  IF v_cnt > 0 THEN
    Set_Item_Property ...etc...;
  END IF;
-- etc --
[bigcheeks]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
If your cursor is in a field, there are some properties (navigable & visible) you cannot change on that field.

Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
Author and Sole Proprietor of: Emu Products Plus
 
I forgot to copy and paste the 'end if' - but that was the first thing I ran back to check, lol. It's alway's the simple things that you overlook! My cdtrans can actually equal a few different things, but maybe I can try playing with doing it that way anyway. The cursor has not yet hit the actual field when the cursor is run. The cursor is run when you tab out of the fieldwhere you enter the initial information that initiates the query.
 
Duh! Remove the ":".
Code:
Set_Item_Property ('b_personn.NB_adcityc',Navigable,Property_true);

Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
Author and Sole Proprietor of: Emu Products Plus
 
You're right! A big DUH! I can't believe I missed that (yes I can - like I said - it's always the simple things you overlook!)Thank you very much for the second set of eyes!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top