Home » Developer & Programmer » Forms » COMPARE ONE WITH MANY
COMPARE ONE WITH MANY [message #242696] Mon, 04 June 2007 13:15 Go to next message
rajat_chaudhary
Messages: 141
Registered: November 2006
Location: india
Senior Member

HI EVERYONE,

DECLARE
  CURSOR C_EMP IS
  SELECT FIRST_NAME FROM EMPLOYEES
  WHERE DEPARTMENT_ID = &DEPT_ID;
  VAR_EMP_NAME EMPLOYEES.FIRST_NAME%TYPE
BEGIN
 OPEN C_EMP;
 LOOP
   FETCH C_EMP INTO VAR_EMP_NAME;
   EXIT WHEN C_EMP%NOTFOUND;
   IF
     :<BLOCK_NAME>.<ITEM_NAME> <> VAR_EMP_NAME THEN
     MESSAGE('NAME IS DIFFERENT.');
    ELSE
     NULL;
    END IF;
   END LOOP;
END;
/

THE ABOVE MENTIONED CODE GIVES MORE THAN ONE VALUE IN A CURSOR AND :<BLOCK_NAME>.<ITEM_NAME> IS ONLY ONE VALUE ,SO TO CHECK IT OUT
EITHER THE ENTERED VALUE IN :<BLOCK_NAME>.<ITEM_NAME> IS NOT EQUAL TO THE VARIALE (CONTAINING MORE THAN ONE VALUES)
OR
IT IS EQUAL .....

THEN IF CONDITION DECIDE WHAT TO DO....?????

BUT THE QUESTION IS TO COMPARE A VALUE OF ONE TEXT_ITEM WITH THE VARIABLE CONTAINING MORE THAN ONE VALUE..........

REGARDS
RAJAT CHAUDAHRY

[Updated on: Mon, 04 June 2007 13:16]

Report message to a moderator

Re: COMPARE ONE WITH MANY [message #242723 is a reply to message #242696] Mon, 04 June 2007 20:17 Go to previous message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Then what's the problem? It will compare records(from cursor) 1 by 1 with that item.
Please refrain fron using ALL CAPS when posting.
Previous Topic: Version Control System
Next Topic: set_block_property --for a non database block
Goto Forum:
  


Current Time: Mon Dec 05 21:27:10 CST 2016

Total time taken to generate the page: 0.13782 seconds