sql - Creating functions in postgresql -
i new sql, please try not overly critical question, need create function return me table (say example "machine") , have column called "aggtablename" , rows filled values derived database. here tried , following error came....so please me in making syntax correct, thanks..
create function aggtable() returns table (machineid, serveraggtablename) $table$ begin return query select m.machineid, m.serveraggtablename machine m end; $table$ language plpgsql; select aggtable();
error: function aggtable() not exist line 1: select aggtable(); ^ hint: no function matches given name , argument types. might need add explicit type casts.
the arguments of table you're returning not have type.
try adding type such machineid int.
check post
Comments
Post a Comment