0

I have a problem whith my query sql in OracleDataAdpater with my API.

Working in my API: select * from table where colum = :value

Not Working error ORA-01008: not all variables bound:

select * from table where colum = &value

I need because my final query should be with IN becasuse =: is not working to list values

select * from table where colum IN( &value)

Final query: select * from table where colum IN('001','002','003');

Thanks

roasdu
  • 1
  • Please share a [mcve]. – mjwills Jul 07 '21 at 11:00
  • You can't pass an array as a single value. `IN` works with individual values, not an array of values. `Oracle parameter names start with `:`, not `&`. Changing that prefix won't change the parameter type – Panagiotis Kanavos Jul 07 '21 at 11:07
  • SQL, the language, doesn't allow using `IN` with a data source like a table or array. That expression is specifically used to specify that a field is equal to one of the supplied values. Reading data from a set is done using `FROM` and `SELECT` – Panagiotis Kanavos Jul 07 '21 at 11:12
  • Thanks: Them I have to do something like: select * from table where colum IN(:value1, :value2, value3); How can I assing the differents values to the same variable? – roasdu Jul 07 '21 at 11:15
  • Panagiotis comments that cant't I use IN, then in SQL only can use OR? like that select * from where colum =: value1 or colum =: value2 or colum =: value1 – roasdu Jul 07 '21 at 11:31
  • Please read the duplicate links. – mjwills Jul 08 '21 at 00:27
  • `Thanks: Them I have to do something like: select * from table where colum IN(:value1, :value2, value3); How can I assing the differents values to the same variable?` You aren't assigning them to the same variable. You are assigning _three different_ variables. – mjwills Jul 08 '21 at 00:28

0 Answers0