Skip site navigation (1) Skip section navigation (2)

AW: AW: SQL99 functions

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: AW: AW: SQL99 functions
Date: 2000-06-28 08:16:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at> writes:
> >> Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)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


pgsql-hackers by date

Next:From: Zeugswetter Andreas SBDate: 2000-06-28 08:26:22
Subject: AW: AW: Proposal: More flexible backup/restore via pg_dump
Previous:From: Zeugswetter Andreas SBDate: 2000-06-28 07:48:54
Subject: AW: Big 7.1 open items

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group