Search Postgresql Archives

handling out parameter

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

 



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

 


[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