"Phil Endecott" <[EMAIL PROTECTED]> writes:
> I think what I really need is an introspection mechanism
> so that I can loop over each element of the record and construct the
> insert as a string. Maybe this is possible using a different
> server-side language?
pltcl can probably handle this; I'm
Phil Endecott wrote:
> !! execute ''column_values :=
> !! column_values || quote_literal(r.'' || cr.column_name || '')'';
I'm guessing you want something like
FOR rec IN EXECUTE ''select column_values || quote_literal(r.'' || cr.column_name ||
'') alias column_values''; LOOP
column_values
I wrote:
> perhaps rather than inspecting the record variable to see what fields
> it contains, I can look at the table to see what columns it contains
This is my effort. It doesn't work, because I can only EXECUTE
SQL statements, not PLPGSQL statements. I need to EXECUTE an
assignment statement
Phil> Insert from a record variable?
Riccardo> Try insert into table select r.*;
Tom> in 7.5
Tom> insert into table select r.*;
Tom> insert into table values(r.*);
Tom> so long as r is declared to be of a named rowtype (not just
Tom> RECORD)
Thanks! Unfortunately I need record, rather
Does plperl catch the plan also?
Thanks.
Jie Liang
-Original Message-
From: Kris Jurka [mailto:[EMAIL PROTECTED]
Sent: Friday, June 18, 2004 2:47 PM
To: Jie Liang
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [JDBC] Prepare Statement
On Fri, 18 Jun 2004, Jie Liang wrote:
>
On Monday 21 Jun 2004 3:19 pm, Tom Lane wrote:
> Gary Stainburn <[EMAIL PROTECTED]> writes:
> > from requests r, users u, request_types t,
> > request_states s, dealerships d, departments de, customers c
> > left outer join (select co_r_id, count(co_r_id) from comments
> >
Gary Stainburn <[EMAIL PROTECTED]> writes:
> from requests r, users u, request_types t,
> request_states s, dealerships d, departments de, customers c
> left outer join (select co_r_id, count(co_r_id) from comments group
> by co_r_id) co on
> co.co_r_id = r.r_
Pradeepkumar, Pyatalo (IE10) wrote:
Well this is right for the local variablesbut what about the function
parameters. Okay, I will make it more simplesay I want to write a
function like this
CREATE FUNCTION test(integer,integer) RETURNS INTEGER AS '
DECLARE
param1 ALIAS FOR $1;
param2
Hi,
Quote from Section 37.11 of the manual:
# There are no default values for parameters in PostgreSQL.
# You can overload function names in PostgreSQL. This is often used
to work around the lack of default parameters.
So for your example:
> CREATE FUNCTION test(integer,integer) RETURNS INTEG
Well this is right for the local variablesbut what about the function
parameters. Okay, I will make it more simplesay I want to write a
function like this
CREATE FUNCTION test(integer,integer) RETURNS INTEGER AS '
DECLARE
param1 ALIAS FOR $1;
param2 ALIAS FOR $2;
BEGIN
---
Hi folks,
I've got the view:
create view nrequest_details as
select r.r_id, r_registration, r.r_chassis, r.r_vehicle,
r.r_fuel,r.r_pack_mats,
r.r_delivery, r_delivery::date-now()::date as r_remaining,
r.r_created, r.r_completed,
d.d_des, de.de_des,
u.u_id,
Luis Neves wrote:
In the above table why does the query:
UPDATE "story"
SET id = (id + 1500);
fails with:
"ERROR: duplicate key violates unique constraint 'story_pkey'"
(I have 6000 records in the table with "id" spanning from 1 to 6000)
I find this behaviour strange, SQL is a set based language,
Dear Pradeep ,
CREATE PROC PP_ReadPointByValue
@SessionID int = NULL, --these r default parameters
SessionID INT := NULL;
@SPSID int = 1,--default value
SPSID int := 1 ;
@ParameterName nvarchar (50) = NULL, -- if NULL read all parameters
ParameterName varchar(50) := NULL ;
@NumValue real
hello
it might be stupid...
sometimes i am starving UPDATE OR INSERT command
thnx
---(end of broadcast)---
TIP 8: explain analyze is your friend
Joe Conway schrieb:
Torsten Lange wrote:
Hello, I have a table with measurement values and columns like
this: analyses(id, sample_id, parameter[temperatur...], value,
unit[?C...], error) With PL/PgSQL at the end I want try
to perform a pivot-like arrangement of these dat
15 matches
Mail list logo