Thursday, September 15, 2016

Printing ascending number using loop : second example

--argument is 2 integers
--prints integers from lowest to highest

create or replace function printnumber(l int, h int)
    returns void as $$
declare
    i int;   
begin
       << loop1 >>
       for i in l..h loop
        raise notice '%', i;     
       end loop loop1;   
end $$language plpgsql;




No comments:

Post a Comment