Search Postgresql Archives

Functions that return RECORD type

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

 



Hi

I come from a MS-SQL background and am trying to figure out what is wrong
with the function below:
****************************************************************************
*************
CREATE OR REPLACE FUNCTION GetAccountInfo (p_AccID int)
RETURNS record
AS
$$
DECLARE
 r_Return record;
BEGIN
 SELECT a.Field1, a.Field2, a.Field4
 INTO r_Return
 FROM Account
 WHERE a.AccID = p_AccID;

 RETURN r_Return;
END;
$$
language 'plpgsql';
****************************************************************************
*************
When I run     select * from GetAccountInfo (100)    I get the following
error message: ERROR:  a column definition list is required for functions
returning "record"

please can someone explain to me how to create a column definition list.


Thanks


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[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