Search Postgresql Archives

CREATE FUNCTION Fails with an Insert Statement in it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have created the following function :


CREATE OR REPLACE FUNCTION  sp_insert_tbl_l_header(int4,text)
 RETURNS bool AS
$BODY$
INSERT INTO tbl_xyz
(unmask_id,email_from)
VALUES ($1,$2)
$BODY$
 LANGUAGE 'sql' VOLATILE;

when i try to create this fucntion by running this script, i get the
following error:

ERROR:  return type mismatch in function declared to return boolean
DETAIL:  Function's final statement must be a SELECT.
CONTEXT:  SQL function "sp_insert_tbl_xyz"

So i think there is some problem with the return type of the function
when it has an insert statement but really don't know what should be
the return type of this function.

Thanks,
Jas


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux