Re: Stored procedure - change columns in a table that is being updated / inserted on?

Поиск
Список
Период
Сортировка
От bryan@flyingiranch.com
Тема Re: Stored procedure - change columns in a table that is being updated / inserted on?
Дата
Msg-id H00000660001d07f.1047165655.mule.flyingiranch.com@MHS
обсуждение исходный текст
Ответ на Stored procedure - change columns in a table that is being updated / inserted on?  (bryan@flyingiranch.com)
Ответы Re: Stored procedure - change columns in a table that is  (Joe Conway <mail@joeconway.com>)
Список pgsql-novice
> This sure seems like the hard way to do it.  If you really want
> tbluserhealthcalculated to be separate from the underlying table,
> why don't you make it a view?
>
> CREATE VIEW tbluserhealthcalculated AS
> SELECT *, (userWeight / (userHeight * userHeight)) AS bmi
> FROM tbluserhealthbasic;

Next question: One of the reasons a function is attractive to me in this
situation is that I also have some conditionals to handle. For instance,
Base Metabolic Rate is different whether you are male or female (gender
is a boolean value in my table). Can I use IF/THEN syntax in a view
definition?

Bryan


Вложения

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

Предыдущее
От: bryan@flyingiranch.com
Дата:
Сообщение: Re: Stored procedure - change columns in a table that is being updated / inserted on?
Следующее
От: "Rod Kreisler"
Дата:
Сообщение: String manipulation in plpgsql