Search Postgresql Archives

Re: Select into table%ROWTYPE failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



marcelo <marcelo.nicolet@xxxxxxxxx> 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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux