Return rows from a PL/pgSQL function

前端 未结 3 1533
感情败类
感情败类 2020-12-21 21:07

I have a procedure in PostgreSQL:

CREATE OR REPLACE FUNCTION get_geom_difference()
RETURNS void AS
$$
BEGIN
SELECT filedata.num,st_area(ST_Difference(ST_TRAN         


        
3条回答
  •  囚心锁ツ
    2020-12-21 21:42

    In your definition your function returns nothing RETURNS void. If you want num data type just change to RETURNS numeric. Also, To make it worked, perform select into some numeric variable SELECT INTO var and add return var to the end of function.

提交回复
热议问题