stored procedure multiple call call question

Поиск
Список
Период
Сортировка
От Chris McDonald
Тема stored procedure multiple call call question
Дата
Msg-id d77dd750-fbe7-4219-a849-761eac5d311e@googlegroups.com
обсуждение исходный текст
Ответы Re: stored procedure multiple call call question  (Chris McDonald <chrisjonmcdonald@gmail.com>)
Re: stored procedure multiple call call question  ("David Johnston" <polobo@yahoo.com>)
Re: stored procedure multiple call call question  (Chris McDonald <chrisjonmcdonald@gmail.com>)
Список pgsql-general
Hi,


If I had a single table targ to insert into I would do an

  INSERT INTO targ SELECT thiscol, thatcol, theothercol FROM FOO.

The problem is that I have tables targ1, targ2, targn to insert things into and a nice stored procedure myproc which
doesthe insertion into all 3 tables - problem is that I dont see how I can effectively do  

   INSERT INTO myproc SELECT thiscol, thatcol, theothercol FROM FOO.

The only way I can work out how to do this is with another stored procedure which allows me to do:

   FOR rec IN SELECT thiscol, thatcol, theothercol
   FROM FOO
   LOOP
      PERFORM myproc(rec.thiscol, rec.thatcol, rec.theothercol);
   END LOOP;

But is there a way to do this just in SQL only without resorting to plpgsql or a language like C/Java?

thanks

c


В списке pgsql-general по дате отправления:

Предыдущее
От: ChoonSoo Park
Дата:
Сообщение: Re: How to search for composite type array
Следующее
От: Chris McDonald
Дата:
Сообщение: Re: stored procedure multiple call call question