You checked that test case right ? :-)
SQL> insert into t (111, 'MGR_123 NAME 123');
insert into t (111, 'MGR_123 NAME 123')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into t (123, 'Silvaji_521 main 234');
insert into t (123, 'Silvaji_521 main 234')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into t (786, 'Rajini_786 sounth 111');
insert into t (786, 'Rajini_786 sounth 111')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into t (678, 'vIKRAm_333 nila 532441');
insert into t (678, 'vIKRAm_333 nila 532441')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into t (987, 'SURYA_55 jo 11231');
insert into t (987, 'SURYA_55 jo 11231')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
Anyway.... you can convert a string into a set of rows via a number of means, for example:
SQL> variable str varchar2(100)
SQL> exec :str := 'mgr,soun,5324,';
PL/SQL procedure successfully completed.
SQL>
SQL> select substr(:str,
2 loc,nvl(
3 lead(loc) over ( order by loc ) – loc-1,
4 length(:str)-loc)
5 ) list_as_rows
6 from (
7 select distinct (instr(','||:str,',',1,level)) loc
8 from dual
9 connect by level <= length(:str)-length(replace(:str,','))
10 );
LIST_AS_ROWS
---------------------------------------------------------------------
mgr
soun
5324
And once you've done that, its just a case of doing a normal join
SQL> create table t (id number, name varchar2(30));
Table created.
SQL>
SQL> insert into t values(111, 'MGR_123 NAME 123');
1 row created.
SQL> insert into t values(123, 'Silvaji_521 main 234');
1 row created.
SQL> insert into t values(786, 'Rajini_786 sounth 111');
1 row created.
SQL> insert into t values(678, 'vIKRAm_333 nila 532441');
1 row created.
SQL> insert into t values(987, 'SURYA_55 jo 11231');
1 row created.
SQL>
SQL> variable str varchar2(100)
SQL> exec :str := 'mgr,soun,5324,';
PL/SQL procedure successfully completed.
SQL>
SQL> with x as
2 (
3 select substr(:str,
4 loc,nvl(
5 lead(loc) over ( order by loc ) – loc-1,
6 length(:str)-loc)
7 ) list_as_rows
8 from (
9 select distinct (instr(','||:str,',',1,level)) loc
10 from dual
11 connect by level <= length(:str)-length(replace(:str,','))
12 )
13 )
14 select *
15 from t, x
16 where instr(name,list_as_rows) > 0;
ID NAME LIST_AS_ROWS
---------- ------------------------------ --------------------------------------------------------------------------------------------------------------------------------
786 Rajini_786 sounth 111 soun
678 vIKRAm_333 nila 532441 5324
2 rows selected.
SQL>
SQL>
SQL>
SQL>
Use upper/lower where appropriate if you want case insensitive checks