This question might seem to be a possible duplicate of How to print values in the loop. Even though the particular link contains a good solution it, doesn't seems to work for me. This is the core part of the stored procedure that I've written.
BEGIN 
FOR i IN 1..10 LOOP
    RAISE NOTICE 'i is %',i;
END LOOP;
RETURN; 
END; 
While executing the procedure I'm always getting the result as
No rows found.
Total runtime: 1.787 ms
SQL executed.
Can someone tell me how to print the value of i? The postgresql version that I'm using is 8.4. Any help is greatly appreciated.
The code looks well. There are few possibilities:
you have higher client_min_messages than notice- can be changed by command:
SET client_min_messages TO notice;
you are looking to wrong window - Server messages are shown in other window than result usually. In pgAdmin, you have to choose a tab Messages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With