how to search a value in a string
426330Jul 28 2004 — edited Jul 28 2004Greate oracle programmers
how are u all doing. i am facing a problem in query. actually i wanna search a value in string using query. just read the piece of code below
DECLARE
LC_VALUE VARCHAR2(100) := '51,52,53,54';
CHK NUMBER;
BEGIN
SELECT 1 INTO CHK
FROM DUAL
WHERE TO_CHAR(51) IN (LC_VALUE);
MESSAGE(CHK);PAUSE;
EXCEPTION WHEN OTHERS THEN
MESSAGE(SQLERRM);PAUSE;
END;
I am unable to find my value in string using query. i have tried the instr function also but the problem with this function is that suppose if i wanna search '1' in '51,52,53' then the value is found in string although there is not as such value as but 51. also i dont want to use the dynamic SQL for this pupose
i m waiting for repsonse please help me out.
Regards
Kamran Ahmed
kah_pk@hotmail.com