In DB2, i need to select rows from a single column based on the value of a host variable.
The db column can contain a 'D' or 'P' only.
The host variable can contain the value 'D' or 'P' or 'B' (all rows).
When the host variable is a 'D', I want to select only rows with a 'D'. When the host variable is a 'P', I want to select only rows with a 'P'. When the host variable is a 'B', I want to select ALL rows.
I am doing this in RPG using embedded SQL.
Thanks in advance