I am trying to parse an existing Oracle query written by a retired developer. I'm not very good at Oracle, and I am a little confused about using this function DECODEin the application Microfocus COBOL(where :BV-POS_YEARis the variable set for the year):
SELECT ...., DECODE(DELV_YEAR, NULL, :BV-POS_YEAR, DELV_YEAR), ....
I am trying to understand how this will differ from:
SELECT ...., NVL(DELV_YEAR, :BV-POS_YEAR), ....
I don’t understand something about functions DECODEor NVL? The developer is aware of the NVL function because it is used elsewhere in the select statement itself.
source
share