postgresql equivalent to ms access parameter query - Mailing list pgsql-odbc

From David P. Lurie
Subject postgresql equivalent to ms access parameter query
Date
Msg-id c3ouup$n9p$1@sea.gmane.org
Whole thread Raw
Responses Re: postgresql equivalent to ms access parameter query
List 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





pgsql-odbc by date:

Previous
From: Chris Gamache
Date:
Subject: Tracking down "unexpected EOF on client connection"
Next
From: Jefferson Medeiros
Date:
Subject: Function sequence error on delete or update