Home » Developer & Programmer » Forms » Urgent: problem in if-else statment.
icon2.gif  Urgent: problem in if-else statment. [message #210111] Tue, 19 December 2006 07:37 Go to next message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member

hi all ,
i have a problem,is
i have a table LDR_INFO(ldr varchar2(15) primary key ,yr date,counts number).ok

i simple insert values in thsi table and want to check before new entry
if the values of 'counts' reach to 20 then show an alert.

but

Quote:
procedure ldr is

v_count number:=1;


begin
insert into ldr_info values (:ldr,:yr,v_count);

elsIF V_COUNT=20 THEN -- i want to check ,is counts field of ldr_info reached to 20.



V_COUNT:=SHOW_ALERT('ALERT1') ;

ELSE


UPDATE LEADER_INFO SET COUNTs =counts+1 ;
STANDARD.COMMIT;

END IF;

end if;

end;


problem is when i put statment as .

elseif counts=20 then --- error (counts my be declare ).
or
elseif max(counts)= 20 then --- max function allowed in select only.


so how can i perform this check .i know there is a very small point in above .but now at this time i m fed-up ,so u plz help me kindlly.

regrads.
Re: Urgent: problem in if-else statment. [message #210123 is a reply to message #210111] Tue, 19 December 2006 08:41 Go to previous messageGo to next message
rameshuddaraju
Messages: 69
Registered: June 2005
Location: India
Member


V_COUNT:=SHOW_ALERT('ALERT1') ;



your problem seems may be related to forms

take a global variable then increment it when ever you perform an insert then check it's count.
if it reaches 20 then show alert.




Re: Urgent: problem in if-else statment. [message #210155 is a reply to message #210111] Tue, 19 December 2006 12:34 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Please stop using URGENT in all of your questions. I for one will not answer any question that uses urgent in the subject. We really don't care that you did not do the appropriate research in advance of your deadlines.
Re: Urgent: problem in if-else statment. [message #210157 is a reply to message #210111] Tue, 19 December 2006 12:55 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
The lack of planning on your part does NOT constitute an emergency on our part.
With free advice you get what you paid for it!
Re: Urgent: problem in if-else statment. [message #210254 is a reply to message #210157] Wed, 20 December 2006 01:04 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Moved to Forms.

MHE
Previous Topic: Why Modal window closes?
Next Topic: ORA-106556 (Word Viewer cannot open the document ...)
Goto Forum:
  


Current Time: Fri Sep 20 15:30:37 CDT 2024