Thanks unclejimbob...but I was referring to an 'if then else' within a select statement - i.e. a case equivalent but using IB6. It has to be within a select statement, not a stored procedure. This is certainly embarassing stuff to be discussing publicly but the truth is...I can't find a way to do this utterly fundamental operation! It wouldn't surprise me if you can't do it - and IB6 forces you to write a stored procedure. But that would be ridiculous. FYI - Oracle decode is like an if then else, i.e.
SELECT supplier_name,
decode(supplier_id, 10000, 'IBM',
10001, 'Microsoft',
10002, 'Hewlett Packard',
'Gateway') result
FROM suppliers;
is equivalent to:
IF supplier_id = 10000 THEN
result := 'IBM';
ELSIF supplier_id = 10001 THEN
result := 'Microsoft';
ELSIF supplier_id = 10002 THEN
result := 'Hewlett Packard';
ELSE
result := 'Gateway';
END IF;
Ill check out the references (appreciated for those) - but if there's a simple resolution to this, i'd be grateful for a reply. Many thanks...Jon