how to call a function with row-type arg

Поиск
Список
Период
Сортировка
Искать

how to call a function with row-type arg

От:
sad <sad@bankir.ru>
Дата:
hihow to call a function with a row_type arg ??that is the question

CREATE FUNCTION foo(tablename) returns int .....

SELECT foo ( ??????? );



Re: how to call a function with row-type arg

От:
"Richard Hall" <rhall@micropat.com>
Дата:
DECLARE
    I INTEGER;
BEGIN
    SELECT *
      INTO I
      FROM foo( <tablename> )

That part is easy, but I don't understand what you are using as a function parameter.

Rick

sad wrote:

hi
 how to call a function with a row_type arg ??
 that is the question

CREATE FUNCTION foo(tablename) returns int .....

SELECT foo ( ??????? );

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

Re: how to call a function with row-type arg

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
sad  writes:
>  how to call a function with a row_type arg ??

> CREATE FUNCTION foo(tablename) returns int .....
SELECT foo(tablename) FROM tablename;
orSELECT foo(tablename.*) FROM tablename;

The first is traditional Postgres usage, but I think the second makes it
more clear what's going on.

BTW, if you use a table alias then the alias is the name to refer to.
SELECT foo(x.*) FROM tablename as x;
		regards, tom lane

FAQ