Re: error: insert has more expressions than target column - Mailing list pgsql-general

From Dino Vliet
Subject Re: error: insert has more expressions than target column
Date
Msg-id 20040907140708.22755.qmail@web40102.mail.yahoo.com
Whole thread Raw
In response to Re: error: insert has more expressions than target column  (Richard Huxton <dev@archonet.com>)
Responses Re: error: insert has more expressions than target column  (Richard Huxton <dev@archonet.com>)
Re: error: insert has more expressions than target column  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm getting the same error without brackets.

The EXECUTE statement was because I read something
about executing dynamic content.

I want to add 7 days to the date value of startdate
and want to repeat it every week. Because there are 8
weeks I choose to do that with the for loop going from
0 to 7.

Thanks in advance

--- Richard Huxton <dev@archonet.com> wrote:

> Dino Vliet wrote:
> > Hi there,
> > I want to put a number of records (variable number
> > depending on a attribute of a table) into a
> certain
> > table with a trigger statement.
> >
> > I have created the follwing trigger:
> >
> > CREATE FUNCTION vullalles() RETURNS trigger AS '
> > BEGIN
> > FOR i in 0..7 LOOP
> > INSERT INTO lessons (select
> >
>
dayofweek,startdate,endate,startime,endtime,teacher,location,roomnr
> > from courseschedule);
>
> Try it without the brackets around select, or put
> the column-names in
> brackets before it.
>
> > startdate := startdate + i*7;
> > EXECUTE startdate;
>
> Not sure what this is supposed to be doing. The
> EXECUTE is redundant.
>
> > RETURN NEW;
> > END LOOP;
> > END;
> > ' LANGUAGE plpgsql;
>
> --
>    Richard Huxton
>    Archonet Ltd
>




__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: error: insert has more expressions than target column
Next
From: Oliver Elphick
Date:
Subject: Re: restricting non superuser from accessing other