From: | Dino Vliet <dino_vliet(at)yahoo(dot)com> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: error: insert has more expressions than target column |
Date: | 2004-09-07 14:07:08 |
Message-ID: | 20040907140708.22755.qmail@web40102.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)archonet(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 2004-09-07 14:15:48 | Re: restricting non superuser from accessing other |
Previous Message | Richard Huxton | 2004-09-07 13:59:03 | Re: error: insert has more expressions than target column |