Re: error: insert has more expressions than target column

Поиск
Список
Период
Сортировка
От Dino Vliet
Тема Re: error: insert has more expressions than target column
Дата
Msg-id 20040907140708.22755.qmail@web40102.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: error: insert has more expressions than target column  (Richard Huxton <dev@archonet.com>)
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: error: insert has more expressions than target column
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: restricting non superuser from accessing other