Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to search a value in a string

426330Jul 28 2004 — edited Jul 28 2004
Greate 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





Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2004
Added on Jul 28 2004
6 comments
412 views