oracle - Passing multiple values on 'IN' where clause -


i tyring figure out solution issue in concurrent program passes in multiple values free text field parameter. on rdbms : 11.2.0.3.0 , oracle applications : 12.1.3 .the concurrent program calls custom plsql procedure produces xml output based on parameters passed in. i've tried create clause dynamically in efforts make sys_refcursor work shown below. i've tried regexp_substr create list of values once parameter string passed in , did not work either. i've tried fails error below. can take , let me know how can make work?

this error receiving: pl/sql: numeric or value error: invalid lob locator specified: ora-22275.

here example of problem.

declare ctx dbms_xmlgen.ctxhandle; ref_cur   sys_refcursor; xmldoc  clob; v_company varchar2(25); v_major_acct varchar2(150); v_major_acct_free varchar2(150); l_length number; l_offset number := 1; l_amount number:=16383; l_rpt_data varchar2(32767); v_where varchar(32000);  begin  dbms_lob.createtemporary(xmldoc,true); v_company := '00110';--p_company; v_major_acct:=('310;765');--p_major_acct; -----> when pass 1 value works fails 2 values.  if v_major_acct not null          v_major_acct_free := '';        select   replace (v_major_acct, ';', ''',''')           v_major_acct_free           dual;        v_major_acct_free := '(''' || v_major_acct_free || ''')';        v_where:=v_where||'and major_acct in' || v_major_acct_free; end if;  open ref_cur ' select * view company =nvl(:v_company, company)'||v_where ---v_where contains , major_acct in ('310','765') fails. using v_company; ctx := dbms_xmlgen.newcontext(ref_cur); xmldoc := dbms_xmlgen.getxml(ctx); l_length := nvl(dbms_lob.getlength(xmldoc),0); fnd_file.put_line (fnd_file.log, l_length);     if (nvl(l_length,0) > 0)       loop          exit when l_length <= 0;          dbms_lob.read (xmldoc, l_amount, l_offset, l_rpt_data);          fnd_file.put (fnd_file.output, l_rpt_data);          -- dbms_output.put_line(l_rpt_data);          l_length := l_length - l_amount;          l_offset := l_offset + l_amount;       end loop;    end if;    dbms_lob.freetemporary(xmldoc);    close ref_cur;    dbms_xmlgen.closecontext(ctx);  exception     when others       dbms_xmlgen.closecontext(ctx);       fnd_file.put (fnd_file.output, v_major_acct);       --errbuf := 'process failed following error: '||sqlerrm;       --retcode := 2;       --raise_application_error (-20000,'process failed'||sqlcode||' -error- '||sqlerrm); end; / 

thanks in advance feedback.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -