I need to dynamically create a query and execute using Execute Immediate, I am facing the problem in appending the Vaaray variable. Getting Error
pls-00306 wrong number or types of arguments in call to ||
Vaaray //Its a type number
select ver_id bulk collect into Ver_Array from ( Select id from table)
No issue with below query as only id variable is used:
Execute Immediate 'Select ID, name , Date, time
from table
where id = ' || v_UC2_id
Error with below query
Execute Immediate 'Select ID, name , Date, time
from table
where id = ' || v_UC2_id
|| ' and ver_id in ( SELECT * FROM TABLE ( '
|| Ver_Array
|| ' )'
Tried to extract the query and concatenate in comma saperated values but the final result comes as String but field used in query is Number
Not sure how to handle this in dynamic query