On Sep 2, 2011, at 2:31 PM, Bob Pawley wrote:
> 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??
Building queries this way is tedious & error prone; that'
-Original Message-
From: Bill Moran
Sent: Friday, September 02, 2011 10:53 AM
To: Bob Pawley
Cc: Postgresql
Subject: Re: [GENERAL] Variable column name
In response to "Bob Pawley" :
I am getting an error -- "column "1" does not exist"
Select
In response to "Bob Pawley" :
>
> I am getting an error -- "column "1" does not exist"
> 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
i
-Original Message-
From: Raymond O'Donnell
Sent: Friday, September 02, 2011 10:38 AM
To: Bob Pawley
Cc: Bill Moran ; Postgresql
Subject: Re: [GENERAL] Variable column name
On 02/09/2011 18:33, Bob Pawley wrote:
-Original Message-
From: Bill Moran
Sent: Thu
On 02/09/2011 18:33, Bob Pawley wrote:
>
>
> -Original Message-
>> From: Bill Moran
> Sent: Thursday, September 01, 2011 8:19 AM
> To: Bob Pawley
> Cc: Postgresql
> Subject: Re: [GENERAL] Variable column name
>
> http://www.postgresql.org/docs/9
-Original Message-
From: Bill Moran
Sent: Thursday, September 01, 2011 8:19 AM
To: Bob Pawley
Cc: Postgresql
Subject: Re: [GENERAL] Variable column name
http://www.postgresql.org/docs/9.0/static/plpgsql-statements.html
Section 39.5.4
If you're not familiar with plpgsql at all
In response to "Bob Pawley" :
>
> From: Bill Moran
>
> In response to "Bob Pawley" :
> >
> > I want to add information to multiple columns (20 - 40) by employing a
> > loop. Each pass of the loop will populate one column with an array.
> >
> > I have tried and I have read that variables can not
On Thursday, September 01, 2011 8:04:49 am Bob Pawley wrote:
> -Original Message-
> From: Bill Moran
> Sent: Thursday, September 01, 2011 7:59 AM
> To: Bob Pawley
> Cc: Postgresql
> Subject: Re: [GENERAL] Variable column name
>
> In response to "Bob Pawley&quo
On Sep 1, 2011, at 9:04 AM, Bob Pawley wrote:
> Would it be possible for you to point me to an example??
The EXECUTE command is what you want.
--
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-general mailing list (pgsql-general@
-Original Message-
From: Bill Moran
Sent: Thursday, September 01, 2011 7:59 AM
To: Bob Pawley
Cc: Postgresql
Subject: Re: [GENERAL] Variable column name
In response to "Bob Pawley" :
I want to add information to multiple columns (20 – 40) by employing a
loop. Each pass o
In response to "Bob Pawley" :
>
> I want to add information to multiple columns (20 – 40) by employing a loop.
> Each pass of the loop will populate one column with an array.
>
> I have tried and I have read that variables can not be used to control column
> names.
>
> Is there a means of wor
Hi
I want to add information to multiple columns (20 – 40) by employing a loop.
Each pass of the loop will populate one column with an array.
I have tried and I have read that variables can not be used to control column
names.
Is there a means of working around this restriction other than cre
Richard Huxton wrote:
George Woodring wrote:
Is possible to declare a variable to build the column name
Tableid varchar(20) := TG_RELNAME || ''id'';
And then use this variable to get the PK value?
Tableidvalue int4 := NEW.tableid;
No. You can build a dynamic query via EXECUTE, but that can't acces
George Woodring wrote:
Is possible to declare a variable to build the column name
Tableid varchar(20) := TG_RELNAME || ''id'';
And then use this variable to get the PK value?
Tableidvalue int4 := NEW.tableid;
No. You can build a dynamic query via EXECUTE, but that can't access
NEW/OLD.
--
Richa
I am trying to create a trigger that needs to capture the primary key
value out of NEW variable.
However the trigger can be called from 2 different tables whose PKs are
Table1id
Table2id
Is possible to declare a variable to build the column name
Tableid varchar(20) := TG_RELNAME || ''id'';
And
15 matches
Mail list logo