AW: AW: SQL99 functions

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB
Тема AW: AW: SQL99 functions
Дата
Msg-id 219F68D65015D011A8E000006F8590C605BA59A1@sdexcsrv1.f000.d0188.sd.spardat.at
обсуждение исходный текст
Список pgsql-hackers
 
> Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
> >> Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> >>>> create table t1 (x int);
> >>>> create function foo (out int) returns int as ...;
> >>>> select foo(x) from t1;
> >> 
> >>>> will give two columns for the result.
> >> 
> >> You've *got* to be kidding.
> >> 
> >> To name just one problem with that, where do I put an AS to relabel
> >> the extra column?
> 
> > It gets the name of the variable ( here "out"), no way to rename it,
> > but no problem since you can name the variable however you like.
> 
> What?  OUT is a keyword there; I don't see any explicit name for the
> function's formal parameter at all.

To not look *that* stupid the mistake I made was:I thought the parameter name was not optional

The default for in|out|"in out" is "in" thus I read the function as foo
("out" IN int)
(of course if it was an IN var it does'nt produce an out column and 
thus need no label, mistake 2)

In Oracle the syntax is:varname [IN|OUT|IN OUT] type

Andreas


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

Предыдущее
От: Zeugswetter Andreas SB
Дата:
Сообщение: AW: Big 7.1 open items
Следующее
От: Zeugswetter Andreas SB
Дата:
Сообщение: AW: AW: Proposal: More flexible backup/restore via pg_d ump