PL/SQL - comma separated list within IN CLAUSE

后端 未结 4 790
离开以前
离开以前 2020-12-17 05:52

I am having trouble getting a block of pl/sql code to work. In the top of my procedure I get some data from my oracle apex application on what checkboxes are checked. Becaus

4条回答
  •  情话喂你
    2020-12-17 06:32

    Personally, i like this approach:

    with t as (select 'a,b,c,d,e' str from dual)
    --
    select val
    from t, xmltable('/root/e/text()'
                     passing xmltype('' || replace(t.str,',','')|| '')
                     columns val varchar2(10) path '/'
                    )
    

    Which can be found among other examples in Thread: Split Comma Delimited String Oracle

    If you feel like swamping in even more options, visit the OTN plsql forums.

提交回复
热议问题