Re: how to test my stored procedures?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Yavuz Kavus <yavuzkavus(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to test my stored procedures?
Date: 2006-06-15 07:13:51
Message-ID: 449108AF.8060009@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2006-06-15 07:14:57 Re: Relation "tablename" does not exist
Previous Message Richard Huxton 2006-06-15 07:08:44 Re: how pg_hba.conf