1 Reply Latest reply: Apr 23, 2013 11:25 PM by scott.wesley RSS

    computation using plsql function body

    n_shah18
      Apex 4.2 linux 11gR2


      I am trying to compute a value based on existing data in DB

      Using apex functionality, pl/sql function body to compute AFTER SUBMIT
      declare 
      
          c    number(4);
          temp NUMBER(11,2);
          temp1 NUMBER(11,2);
          --P11_CURRENT_MONTH_EST_TO_DATE  NUMBER(11,2);
          
      begin 
      
            
            select count (*) into c
            FROM REVENUE_ANNUAL 
            where COMPANY_ID=:P11_COMPANY
            and period=:P11_PERIOD;
            
            dbms_output.put_line(c);
       
            if c>0 then
                     
                    SELECT  CURRENT_MONTH_BILLED_TO_DATE
                    into temp
                    FROM REVENUE_ANNUAL 
                    where COMPANY_ID=:P11_COMPANY
                    and period=:P11_PERIOD;
                    --dbms_output.put_line(temp);
                    :P11_X :=:temp;
                   :P11_CURRENT_MONTH_EST_TO_DATE := temp*0.19;
      
      
                  --dbms_output.put_line(P11_CURRENT_MONTH_EST_TO_DATE);
                  
             end if ;
         
         
         end ; 
         
        
      block is executed successfully in sql dev but on insert in apex , it never returns a value.


      Your Help is appreciated.

      Edited by: Hunk09 on Apr 23, 2013 4:04 PM

      Edited by: Hunk09 on Apr 23, 2013 4:06 PM