Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Sergey Konoplev
2010/8/19 Tom Lane : >> 2010/8/18 Horváth Imre : >>> It don't work... > > A function returning a scalar type cannot control the column name > assigned to the scalar in the calling query.  To do that, you need to > return a composite type, which means there need to be at least two OUT > parameters i

Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Tom Lane
> 2010/8/18 Horváth Imre : >> It don't work... A function returning a scalar type cannot control the column name assigned to the scalar in the calling query. To do that, you need to return a composite type, which means there need to be at least two OUT parameters if you're trying to do it via OUT

Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Sergey Konoplev
What is your PG version? 2010/8/18 Horváth Imre : > It don't work... > > Only select into status * from... works. > > Imre Horvath > > 2010. 08. 18, szerda keltezéssel 09.42-kor Sergey Konoplev ezt írta: >> Hi, >> >> SELECT column_name >> INTO var_name >> FROM ... >> >> 2010/8/17 Horváth Imre : >>

Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Imre Horvath
It don't work... Only select into status * from... works. Imre Horvath 2010. 08. 18, szerda keltezéssel 09.42-kor Sergey Konoplev ezt írta: > Hi, > > SELECT column_name > INTO var_name > FROM ... > > 2010/8/17 Horváth Imre : > > Hi! > > > > My question is, how can I get the out

Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Horváth Imre
It don't work... Only select into status * from... works. Imre Horvath 2010. 08. 18, szerda keltezéssel 09.42-kor Sergey Konoplev ezt írta: > Hi, > > SELECT column_name > INTO var_name > FROM ... > > 2010/8/17 Horváth Imre : > > Hi! > > > > My question is, how can I get the out parameter from

Re: [SQL] plpgsql out parameter with select into

2010-08-17 Thread Sergey Konoplev
Hi, SELECT column_name INTO var_name FROM ... 2010/8/17 Horváth Imre : > Hi! > > My question is, how can I get the out parameter from a function with > SELECT INTO by name? > I mean: > > create function testfunc1(OUT _status integer) returns integer as > $BODY$ >        _status := 0; > $BODY$ > l

[SQL] plpgsql out parameter with select into

2010-08-17 Thread Horváth Imre
Hi! My question is, how can I get the out parameter from a function with SELECT INTO by name? I mean: create function testfunc1(OUT _status integer) returns integer as $BODY$ _status := 0; $BODY$ language plpgsql; create function testfunc2() as declare status integer; $BODY$

Re: [SQL] plpgsql out parameter with select into

2010-08-17 Thread Pavel Stehule
Hello It cannot work, you mix the sql with plpgsql language 2010/8/17 Imre Horvath : > Hi! > > My question is, how can I get the out parameter from a function with > SELECT INTO by name? > I mean: > > create function testfunc1(OUT _status integer) returns integer as > $BODY$ >        _status :=

[SQL] plpgsql out parameter with select into

2010-08-17 Thread Imre Horvath
Hi! My question is, how can I get the out parameter from a function with SELECT INTO by name? I mean: create function testfunc1(OUT _status integer) returns integer as $BODY$ _status := 0; $BODY$ language plpgsql; create function testfunc2() as declare status integer; $BODY$