Write an SQR condition statement

I'm new in SQR. I need help to write a variable and use it for a condition statement. my pseudo code goes declare $head_printlet $head_print = (select * from PS_DTR_RPT_ACCTwhere RPT_TREE_NODE = 'REAL_ESTATE_EXP' or TREE_NODE_NUM between 4600000 and 4699999)if(head_print contain REAL_ESTATE_EXP or Account between 46000000 and 4699999)then head_print = "REAL ESTATE";else head_print = "Capital ESTATE";...Read more

Print different sets of data from different tables in one SQR

I have a requirement where in if a PO_ID range is given then I need to do the following:If a PO_ID from the PO_ID range is present in PS_DISTRIB_LINE then print PO_ID and Voucher ID and if not then print PI_ID and PO_DT from PS_PO_HDR.How to achieve this.Union is not working and I am not able to use break logic because if data is present in PS_DISTRIB_LINE then I am printing Sum of PO_AMT Total below the PO_IDs but in other case i am not....Read more