Search Postgresql Archives

Re: Variable column name

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

 





-----Original Message----- From: Bill Moran
Sent: Friday, September 02, 2011 10:53 AM
To: Bob Pawley
Cc: Postgresql
Subject: Re:  Variable column name

In response to "Bob Pawley" <rjpawley@xxxxxxx>:

I am getting an error  -- "column "1" does not exist"

<snip>

    Select "1" into column ;

Where are you selecting "1" from?  This query has no FROM clause, so of
course the column doesn't exist.

The previous query, "SELECT 2 INTO point_array" is going to put the
integer value 2 into the variable point_array, which I'm guessing is
not what you want either.


Well, actually that is what I am attempting.

I added the from clause and that seems to be acceptable for the column identification.

What I am trying to accomplish is to collect distance information between numerous geometries (in this case 8) at the first spatial location and build an array in column 1, one array point at a time.

Then the loop moves to the next location, establishes the geometries and updates the column 2 array with these distances.

It seems to work when I hard code the column name and array point, so I was hoping to make it work through a loop using variables for column and array point.

Does this make sense??

Bob

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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