Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-odbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group