Re: postgres subfunction return error

Поиск
Список
Период
Сортировка
От jonathansfl
Тема Re: postgres subfunction return error
Дата
Msg-id 008201ceba47$91fbb680$b5f32380$@com
обсуждение исходный текст
Ответ на Re: postgres subfunction return error  (David Johnston <polobo@yahoo.com>)
Список pgsql-sql

Thank you!

What kind of variable would I declare? Is this any form of right?

No change to subfunction.

In PARENT Function:

DECLARE v_outvar1 REFCURSOR; v_outvar2 REFCURSOR; v_outvar3 REFCURSOR;

?And use:

SELECT * INTO v_outvar1, v_outvar2, v_outvar3 FROM dev.pr_test_subfunction(SWV_Action);

OPEN swv_refcur    for SELECT v_outvar1;

OPEN swv_refcur2 for SELECT v_outvar2;

OPEN swv_refcur3 for SELECT v_outvar3;

 

 

From: David Johnston [via PostgreSQL] [mailto:[hidden email]]
Sent: Wednesday, September 25, 2013 7:19 PM
To: jonathansfl
Subject: Re: postgres subfunction return error

 

jonathansfl wrote

greetings. I'm trying to write a function that acts like a switchboard, calling other functions depending on incoming parameters.
I'm getting error: query has no destination for result data


    SELECT * FROM dev.pr_test_subfunction(SWV_Action);

In pl/pgsql if you do not use an "INTO" clause on a select statement you must replace the "SELECT" with "PERFORM".  Failing to do so results in the error you are seeing.  In this case your calls to the sub-function do not magically populate the parent function variables.  You must manually map the output of the sub-function call query onto the parent variables.

David J.


If you reply to this email, your message will be added to the discussion below:

click here.
NAML



View this message in context: RE: postgres subfunction return error
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

В списке pgsql-sql по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: postgres subfunction return error
Следующее
От: jonathansfl
Дата:
Сообщение: Re: postgres subfunction return error