A: 

As the hint message states, you are missing an argument to your stored procedure. It expects 2 arguments, but in your column statments:

group_concat(cast(r as char(2))) as r,
group_concat(to_char(datecreated,'DD-Mon-YYYY HH12:MI am')) as datecreated,
group_concat(to_char(datemodified,'DD-Mon-YYYY HH12:MI am')) as datemodified        

you supply only one.

Since PostgreSQL 8.4 default values for arguments are allowed. Take a look at the reference for more information and examples.

Frank Bollack