Friends,
I'm trying to write a select statement that ends like this:
The trouble is that shipto contains a comma delimted list. I think that oracle is expanding it so that it works out to be like this:
So I want it to match against the variable if the value passed isn't 0 but what's happening is the decode function is looking at it as another if/else block.
Any ideas?
Vanguard
I'm trying to write a select statement that ends like this:
Code:
and sc.customer_name in (DECODE(shipto,'0',sc.customer_name,shipto));
The trouble is that shipto contains a comma delimted list. I think that oracle is expanding it so that it works out to be like this:
Code:
and sc.customer_name in (DECODE shipto,'0',sc.customer_name,'XYZ','ABC'));
So I want it to match against the variable if the value passed isn't 0 but what's happening is the decode function is looking at it as another if/else block.
Any ideas?
Vanguard