Re: how to test my stored procedures? - Mailing list pgsql-general

From Richard Huxton
Subject Re: how to test my stored procedures?
Date
Msg-id 449108AF.8060009@archonet.com
Whole thread Raw
In response to how to test my stored procedures?  ("Yavuz Kavus" <yavuzkavus@gmail.com>)
Responses Re: how to test my stored procedures?
List pgsql-general
Yavuz Kavus wrote:
> hi everybody.
>
> i am writing stored procedures.
> lots of them have out parameters.
>
> i dont know how to test them
> from an sql query tool(ex: pgAdmin query tool).
> i am trying to test them from my program, but it is not so efficient.

OUT parameters get returned as part of a record.

CREATE FUNCTION foo(a int4, OUT b int4, OUT c int4) AS $$
BEGIN
   b:=a+1;
   c:=a+2;
END; $$ LANGUAGE plpgsql;


richardh=# SELECT foo(9);
    foo
---------
  (10,11)

HTH
--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: how pg_hba.conf
Next
From: Michael Glaesemann
Date:
Subject: Re: Relation "tablename" does not exist