handling out parameter

From: Ravi Katkar <Ravi(dot)Katkar(at)infor(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: handling out parameter
Date: 2010-06-04 07:12:16
Message-ID: 46AC8D44F3AE1F4888F137837D0DF63507256199A8@INHYWEXMB2.infor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi ,

I have below function adf with inout, out parameter ,

CREATE OR REPLACE FUNCTION adf(inout voutvar integer , out vVar integer)
AS
$BODY$
BEGIN
voutvar := 20;
vvar := 10;
RETURN;
END; $BODY$
LANGUAGE 'plpgsql'

After compiling I get below signature of function

adf(integer)

and return type as record.

CREATE OR REPLACE FUNCTION adf(INOUT voutvar integer, OUT vvar integer)
RETURNS record AS

I wanted to catch output parameter - Vvar .

Below function tt , tries adf,

CREATE OR REPLACE FUNCTION tt()
RETURNS VOID AS
$BODY$
DECLARE
ii integer;
vout integer;
BEGIN
--vvar := 10;
vout := 10;
perform adf(vout) ;
RETURN;
END; $BODY$
LANGUAGE 'plpgsql';

I have a couple of questions on above function

1) Why the return type is record after compiling?
2) How to catch the return value of out parameter for above case value of vVar.

Thanks,
Ravi Katkar

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank van Vugt 2010-06-04 07:16:39 Re: so, does this overlap or not...? - fencepost question on overlaps()
Previous Message peeratat tungsungnern 2010-06-04 07:10:07 please help me. I can't pg_dumg DB