Thread: accessing composite value's field in function

accessing composite value's field in function

From
"Nikita Koselev"
Date:
I try to print out field of composite value in my procedure
--

CREATE OR REPLACE FUNCTION add_position(rs requirement_vo )
  RETURNS void AS
$BODY$
    DECLARE
    BEGIN
    RAISE NOTICE rs.name;
  END;
$BODY$
--
However "rs.name" causes "ERROR: syntax error at or near "rs.name"".
So how should I access composite value's field inside of the function?

--
Nikita Koselev

Re: accessing composite value's field in function

From
"Richard Broersma"
Date:
On Sat, Oct 4, 2008 at 11:59 PM, Nikita Koselev <koselev@gmail.com> wrote:

>        RAISE NOTICE rs.name;
> --
> However "rs.name" causes "ERROR: syntax error at or near "rs.name"".
> So how should I access composite value's field inside of the function?

I think the syntax for the RAISE NOTICE isn't correct.  Notice the
examples in the PostgreSQL manual:
http://www.postgresql.org/docs/8.3/interactive/plpgsql-errors-and-messages.html

Variables like rs.name must be passed into a parametrized message string.


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug