FAQ
Hi,

is there any possibility to feed a "table" function with a query. foe
example

CREATE FUNCTION func(id INT) RETURNS SETOF tmp AS ...

SELECT * FROM func(<scalar>); works as expected

What i want to do is something like

SELECT * FROM func((SELECT id FROM pers WHERE name ILIKE 'w%'));

i am using 8.0 on windows

regards sepp

_________________________________________________________________
Ein gigantisches Konzert kämpft gegen eine fortschreitende Klimakrise.
http://liveearthsos.msn.com/Hub.aspx?mkt=de-at

Search Discussions

  • Derrick Betts at Jun 1, 2007 at 8:31 pm

    Robert Wimmer wrote:
    Hi,

    is there any possibility to feed a "table" function with a query. foe
    example

    CREATE FUNCTION func(id INT) RETURNS SETOF tmp AS ...

    SELECT * FROM func(<scalar>); works as expected

    What i want to do is something like

    SELECT * FROM func((SELECT id FROM pers WHERE name ILIKE 'w%'));

    i am using 8.0 on windows

    regards sepp

    _________________________________________________________________
    Ein gigantisches Konzert kämpft gegen eine fortschreitende Klimakrise.
    http://liveearthsos.msn.com/Hub.aspx?mkt=de-at


    ---------------------------(end of broadcast)---------------------------
    TIP 5: don't forget to increase your free space map settings

    Inside of your function use the EXECUTE command. Execute can execute a
    text string, or a variable that is a qualified SQL command inside pl/pgSQL.
    EXECUTE 'SELECT id FROM pers WHERE name LIKE 'w%''; --I don't remember
    how to work the quotes, you'll have to check the docs.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedJun 1, '07 at 8:18p
activeJun 1, '07 at 8:31p
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Robert Wimmer: 1 post Derrick Betts: 1 post

People

Translate

site design / logo © 2022 Grokbase