Search code examples
postgresql-8.4openbravo

How to Trace through plsql procedure in postgresql 8.4


I am writing a postgresql procedure which calculates the salaries of employees on the basis of their attendance in openbravo. But I am getting wrong values after calculation , Now I just wanted to trace through the procedure , The procedure gets the pinstance id and generates the output, But I just want to check out what is the individual values i am getting in the process, something like we use

system.out.println

in java

please help me.


Solution

  • You can just call the procedure using the query

    select procedure_name (arguments)

    for ex: select calculate_salaries(arguments)

    At specific places where you want to check values just issue RAISE NOTICE as

    RAISE NOTICE '%' ,'value' ||value;

    you will get these values in message tab of Pgadmin and you can cross verify your results

    Hope that helps