How to test if a string is inside a list of predinfined list of string in oracle pl/sql

Posted by drupalspring on Stack Overflow See other posts from Stack Overflow or by drupalspring
Published on 2010-04-30T03:47:54Z Indexed on 2010/04/30 3:57 UTC
Read the original article Hit count: 188

Filed under:

I define a list a string which contains different country codes ( for example , USA ,CHINA ,HK ,JPN) How can I check that if a input variable equal to one of the country of the country list in pl/sql . I use the following code to test it but fail, how can I revise it?

declare country_list CONSTANT VARCHAR2(200) := USA,CHINA,HK,JPN; input VARCHAR2(200); begin input := 'JPN'; IF input IN (country_list) DBMS_OUTPUT.PUT_LINE('It is Inside'); else

     DBMS_OUTPUT.PUT_LINE('It is not  Inside');

END IF; end;

© Stack Overflow or respective owner

Related posts about plsql