how do the pro's do this? (still a newbie)

Поиск
Список
Период
Сортировка
От Gunnar Lindholm
Тема how do the pro's do this? (still a newbie)
Дата
Msg-id 01103013113901.00334@fire
обсуждение исходный текст
Ответы Re: how do the pro's do this? (still a newbie)  (Tod McQuillin <devin@spamcop.net>)
Список pgsql-general
Hello.
As a newbie in the stored procedure programming area I would like to know how
you could do the following with a function in plpgsql.
(It's a theoretical question, so do not suggest changing the tables :-)
I have

 table A :
    id     integer primary key default nextval('something'),
    dohA    integer

table B:
    rid    integer references A,
    dohB    integer

and I wish to create a function "foo( dohA, dohB)" that inserts the values
dohA and dohB into the proper tables A and B and the reference in table B
should of course be connected to the PK in table A. You understand what I
mean, right?

Now, how do I write

   function foo(integer, integer)
      begin work
      ... please fill this space with some code.... !!!!
      commit

Is there some realy good tutorial on this, please tell me so?
TIA, Gunnar.

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

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: [HACKERS] Serious performance problem
Следующее
От: Jean-Michel POURE
Дата:
Сообщение: Re: [HACKERS] Serious performance problem