Search Postgresql Archives

Re: PLSQL function calling another function

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

 



<cyw@xxxxxxx> writes:
> I am trying to figure out how to call one PLSQL function from another, specifically how to access the return values from the callee.

> I made two test functions, A and B. A calls B.

> B returns two values:   
>                 OUT tid integer
>                 OUT msg character varying

> In caller function A, I do the following:
>                 SELECT B(1) INTO rec;       -- rec declared as a RECORD

This produces a record containing a single composite column (named "b"),
as you would see if you did the same SELECT by hand:

regression=# select b(1);
     b     
-----------
 (100,MSG)
(1 row)

You will get the results you expect if you do something like

	select * into rec from b(1);

			regards, tom lane


[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