Oracle - Can A Bind Variable Be Put In In() Clause If The Variable Can Be Empty
In Oracle , can a bind variable be put in IN() clause if it can be empty? Asking because in the SQL if Oracle see IN() without any data in it, it shows error ORA-00936: missing expression. Edit: Failed to mention that no PL/SQL can be used... Edit2: Also failed to mention that the variable is either in format 1,2,3 or empty string. The empty string cannot be replaced with NULL. Seems to be working: declare l_statement varchar2(32767); begin l_statement := 'select * from user_tables where table_name in (:a)'; execute immediate l_statement using ''; end; You can do it, it will be syntactically