postgresql equivalent to ms access parameter query

From: "David P(dot) Lurie" <dbase4(at)hotmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: postgresql equivalent to ms access parameter query
Date: 2004-03-23 09:11:05
Message-ID: c3ouup$n9p$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

What is the postgresql equivalent to an ms access 2002 parameter query?

Postgresql functions written in SQL that return sets from select queries
seem closest.

Table stores has columns of storeid, name, address, etc.

A postgresql SQL procedure retrieves records based on a single column
parameter:

CREATE OR REPLACE FUNCTION public.state(varchar)
RETURNS SETOF stores AS
'
SELECT * from stores where stateorprovince = $1;
'
LANGUAGE 'sql' VOLATILE;

The following SQL statement runs as expected from psql or the pgAdminIII
query window:

SELECT storeid,storename from state('TN');

How is a parameter passed from access to postgresql in a pass-through query
calling a function?

A standard access query (non pass-through) to the postgresql table can
reference a text box control on a form:

SELECT public_stores.storeid, public_stores.storename,
public_stores.address, public_stores.city, public_stores.stateorprovince,
public_stores.postalcode
FROM public_stores
WHERE (((public_stores.stateorprovince)=[Forms]![Form1]![Text0]));

Thanks,

David P. Lurie

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Jefferson Medeiros 2004-03-23 13:50:57 Function sequence error on delete or update
Previous Message Michael Fork 2004-03-23 04:22:17 Re: Data Access Error