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

From: shawn everett <everett(at)pgweb(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is this possible or am I on drugs :)
Date: 2000-11-28 06:38:04
Message-ID: Pine.LNX.4.30.0011272223390.7005-100000@alder.pgweb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tod McQuillin 2000-11-28 06:48:46 Re: Is this possible or am I on drugs :)
Previous Message Tom Lane 2000-11-28 05:48:26 Re: Is this possible or am I on drugs :)