0
I have a situation, using an Oracle-SQL database, where depending on the value informed of a variable (YES/NO), the value being used in the query will change. I tried as below but returns the error:
ORA-00932: inconsistent data types: expected CHAR got SYS.ODCIVARCHAR2LIST
Snippet of SQL I tried to mount (instead of the first’S' goes the variable) of the past.
AND mc.segment3 in (CASE WHEN 'S' = 'S' THEN
sys.odcivarchar2list('060','071')
ELSE sys.odcivarchar2list('059')
END)
You tried to put that in a sub-select?
– Bruno Warmling
@Brunowarmling I’m trying to think of a subselect now
– Diego
( (VS = ’S' AND mc.segment3 IN ('060','071') OR (VS <> ’S' AND mc.segment3 IN ('059') )
– Motta
@Motta, I can’t believe that on a line you solved this...!
– Diego
Not the OS is boring to answer , you need to write a thesis format ABNT ... :) funfou leaves queito.
– Motta