I am dynamically constructing a string with name user_data in PL/Sql procedure by appending USERNAMEs, single quotes(\') and commas(,) of the form
Your select statement
SELECT * FROM table_name WHERE USERNAME IN (user_data)
will be treated as
SELECT * FROM table_name WHERE USERNAME = 'abc123','xyz456','pqr789'
which is not correct.
One alternative is
SELECT * FROM table_name WHERE INSTR(user_data, USERNAME) > 0