Re: Is this possible or am I on drugs :)

Поиск
Список
Период
Сортировка
От shawn everett
Тема Re: Is this possible or am I on drugs :)
Дата
Msg-id Pine.LNX.4.30.0011272223390.7005-100000@alder.pgweb.com
обсуждение исходный текст
Ответ на Re: Is this possible or am I on drugs :)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Is this possible or am I on drugs :)  (Tod McQuillin <devin@spamcop.net>)
Re: Is this possible or am I on drugs :)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> What do you consider "passing a parameter to the view" to be?
>
This is where Microsoft Access has twisted me :)

Access as you may or may not know allows you to use parameters in a query:

SELECT * FROM table WHERE table.pkey=[Enter The Primary Key];

The bit in [] represents a prompt to the user.  They can also be filled in
programatically.

The basic select statement for my problem is going to work as follows:

select colA, colB, colA+colB*0.4 as f1, colC, colC+colD*9 as f2 from table
where date=SomeDateEnteredByTheUser;

Can I pass SomeDateEnteredByTheUser to Postgres in some way and get back
the set of records I want?  If I can is there a way to call this from PHP?

If I can't and end up dynamically writing the query and sumbitting that
to Postgres is this a smart way to do it?

Or should I simply query out the basic values: colA, colB, colC and colD
and then do the calculations within PHP?

Shawn



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Is this possible or am I on drugs :)
Следующее
От: Tod McQuillin
Дата:
Сообщение: Re: Is this possible or am I on drugs :)