I am looking to use an array of values in the WHERE IN condition.
After research, I saw that I had to make a "CREATE TYPE", since a "TYPE" in local does not work. This solution does not suit me, I do not want to make a new TYPE in Oracle, since the database is used for an ERP/PGI I do not wish to pollute with my little need.
My request is the following:
DELETE vip_routage
WHERE vip_tel_ext = w_array_tel(i)
AND ((w_cp NOT IN ('14', '27', '50', '61', '76')
AND SUBSTR(VIP_CODE_POSTAL, 1, 2) IN ('14', '27', '50', '61', '76'))
OR (w_cp IN ('14', '27', '50', '61', '76')
AND SUBSTR(VIP_CODE_POSTAL, 1, 2) IN ('14', '27', '50', '61', '76')
AND TO_NUMBER(vip_dest1) < w_tri_ordre)
OR (w_cp NOT IN ('14', '27', '50', '61', '76')
AND SUBSTR(VIP_CODE_POSTAL, 1, 2) NOT IN ('14', '27', '50', '61', '76')
AND TO_NUMBER(vip_dest1) < w_tri_ordre));
It is the value "('14','27','50','61','76')" that I would like to set as a variable, but only in my program.
Do you have any ideas other than "CREATE TYPE"?
w_array_tel(i)? That looks likew_array_telis a local variable that is a collection,iis the index of the collection, which would imply that you're already in a loop in PL/SQL. Is that the case? What version of Oracle are you using?