PL/SQL rewrite concatenated query with 'IN' clause

前端 未结 2 1469
天命终不由人
天命终不由人 2021-01-24 07:09

Currently I have in my pl/sql code following statements:

-- vList looks like \'1,2,3,4\'     
vStatement := \'SELECT NAME FROM T_USER WHERE ID IN ( \' || vList |         


        
2条回答
  •  被撕碎了的回忆
    2021-01-24 07:53

    It's not just that concatenation is slow. It's that dynamic queries in plsql are REALLY slow. Here's a good writeup of both the how and why to do this:

    Ask Tom: How can I do a variable "in list"

提交回复
热议问题