pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David P. Lurie <dbase4@hotmail.com>
To: pgsql-odbc@postgresql.org
Subject: postgresql equivalent to ms access parameter query
Date: Tue, 23 Mar 2004 04:11:05 -0500
Message-ID: <c3ouup$n9p$1@sea.gmane.org> (raw)

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








view thread (5+ messages)  latest in thread

Message-ID: <c3ouup$n9p$1@sea.gmane.org>
Permalink:  ../c3ouup$n9p$1@sea.gmane.org/
Also on:    postgresql.org/message-id/c3ouup$n9p$1@sea.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: dbase4@hotmail.com
  Subject: Re: postgresql equivalent to ms access parameter query
  In-Reply-To: <c3ouup$n9p$1@sea.gmane.org>
  References: <c3ouup$n9p$1@sea.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox