COMPARE ONE WITH MANY [message #242696] |
Mon, 04 June 2007 13:15 |
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
|
|
|
|