Re: Select into table%ROWTYPE failed - Mailing list pgsql-general

From marcelo
Subject Re: Select into table%ROWTYPE failed
Date
Msg-id 14186ea7-288e-c011-616c-56cd577793cd@gmail.com
Whole thread Raw
In response to Re: Select into table%ROWTYPE failed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Ohh, you are right!
Thank you!

On 18/09/2018 14:10 , Tom Lane wrote:
> marcelo <marcelo.nicolet@gmail.com> writes:
>> What was wrong in the first approach?
> plpgsql's "SELECT INTO" expects a one-for-one match between the output
> columns of the SELECT and the columns of the INTO destination.  So I'd
> expect something like this to work:
>
> DECLARE
>    ranger billnumberrange%ROWTYPE;
> BEGIN
>   SELECT * FROM billnumberrange WHERE ... INTO ranger;
>
> Your example clearly wasn't selecting all the columns, and it
> wasn't clear whether you paid any attention to column ordering;
> but both of those matter.
>
>             regards, tom lane
>


---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus



pgsql-general by date:

Previous
From: VENKTESH GUTTEDAR
Date:
Subject: [GENERAL] optimising the pl/pgsql function
Next
From: Chris Travers
Date:
Subject: Re: Code of Conduct