Home » Developer & Programmer » Forms » How to compare two text boxes with IN operator form (Oracle Forms6i,Oracle 11g,Windows Server 2008)
How to compare two text boxes with IN operator form [message #557355] Tue, 12 June 2012 02:17 Go to next message
jolly_makkar
Messages: 63
Registered: March 2008
Member
Dear all

How we can compare IN operator between two text boxes in form

I have two text boxes on form
control.txt1 - 003

control.txt2 - 001,002,003



On button pressed

if :control.txt1 in (:CONTROL.TXT2) THEN
	MESSAGE('1');
	MESSAGE('1');
	
else
	
	MESSAGE('0');
	MESSAGE('0');
END IF;


All the time Message is 0 .Please suggest what mistake i should rectify to get 1.
Re: How to compare two text boxes with IN operator form [message #557381 is a reply to message #557355] Tue, 12 June 2012 06:25 Go to previous messageGo to next message
cookiemonster
Messages: 10961
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use instr
Re: How to compare two text boxes with IN operator form [message #557400 is a reply to message #557381] Tue, 12 June 2012 08:12 Go to previous messageGo to next message
sandeepgujje
Messages: 28
Registered: January 2012
Location: India
Junior Member
Yes, As suggested by cookiemonster, INSTR will work fine

use the below code,

DECLARE 
  v_val NUMBER;
BEGIN
  v_val := INSTR(:control.txt2, :control.txt1);

  IF nvl(v_val, 0) = 0 THEN
    MESSAGE('0'); PAUSE;
  ELSE
    MESSAGE('1'); PAUSE;
  END IF;
END;

icon14.gif  Re: How to compare two text boxes with IN operator form [message #557474 is a reply to message #557400] Wed, 13 June 2012 01:14 Go to previous messageGo to next message
jolly_makkar
Messages: 63
Registered: March 2008
Member
Thanks Cookiemonster n Sandeep ji ,it worked Smile

[Updated on: Wed, 13 June 2012 01:16]

Report message to a moderator

Re: How to compare two text boxes with IN operator form [message #557829 is a reply to message #557474] Sat, 16 June 2012 01:58 Go to previous message
sasipalarivattom
Messages: 118
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member

Thanks Dear all,

I was looking for something like this.
Previous Topic: WRITE THE VALUES ON 2 LINES DIFFERENTS
Next Topic: How to validate salary regarding to its MIN and MAX value from another table?
Goto Forum:
  


Current Time: Thu Sep 18 09:26:55 CDT 2014

Total time taken to generate the page: 0.08833 seconds