Actually it has to be in the where clause of a select statement. The result ('Y' or 'N') is being compared to
a database field:
WHERE DECODE(database_field, NULL, 'N','N','N','Y') = DECODE(incoming_param,'I', 'Y', 'E', 'N', 'A', 'Y' or 'A', 'N')
getjbb