Issue on function in plsql
I have the below function I am trying to write but when I execute plsql with debugger it says the below error
at line
Begin
SELECT TO_CHAR(ordered_date,'MON')
into odate
FROM oe_order_headers_all
where header_id =p_header_id
execution has terminated at line
' Begin
if avg_ord_qty > fmon then ....'
Could anyone help to solve the issue
I need to compare the average sales of the last 3 month with the forecast. Which ever highest shld be compared with (onhand qty+pending qty-requested qty of actual order) COMAPRED QTY
If average sales or forecast < Compared qty it should return 1 else it return 0