PL/SQL - comma separated list within IN CLAUSE

后端 未结 4 793
离开以前
离开以前 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:33

    I have tried to find a solution for that too but never succeeded. You can build the query as a string and then run EXECUTE IMMEDIATE, see http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/dynamic.htm#i14500.

    That said, it just occurred to me that the argument of an IN clause can be a sub-select:

    SELECT * FROM users 
    WHERE user_id IN (SELECT something FROM somewhere)
    

    so, is it possible to expose the checkbox values as a stored function? Then you might be able to do something like

    SELECT * FROM users
    WHERE user_id IN (SELECT my_package.checkbox_func FROM dual)
    

提交回复
热议问题