declare v_sql varchar2(2000); v_out sys_refcursor; begin v_sql := 'select * from test where id like :1'; open v_out for v_sql using '%001%'; end;