From: Jie Liang <jliang@ipinc.com>
To: Nelson <nbrito@cmet.net>
Cc: pgsql-general@hub.org <pgsql-general@hub.org>
Cc: pgsql-novice@hub.org <pgsql-novice@hub.org>
Cc: pgsql-sql@hub.org <pgsql-sql@hub.org>
Subject: Re: how to store a query, that results in a table
Date: Fri, 22 Sep 2000 15:26:24 -0700
Message-ID: <39CBDC90.7E4700DC@ipinc.com> (raw)
References: <39CB65A0.9DEF7ABB@cmet.net>
<39CBD205.9A922DDE@ipinc.com>
<39CBD883.9A63F0C6@cmet.net>
Hi,
So, your question is not client side,
you want store a procedure in db(server side) can accept para from
client side.
I have not seen Pg has a functionality to do like store procedure or
package like Oracle
( maybe I don't know), so , I suggest that :
1 use embeded SQL
2. store query as a SQL in shell script( because shell script can accept
parameters)
in shell , you can say:
echo "select * from table1 where row1=$1"|rsh pg_server
/usr/local/pgsql/bin/psql -U robt db
(e.g . remote shell call, local is same)
3. if you use bash shell, you can also use
pgbash(http://www.psn.co.jp/PostgreSQL/pgbash/index-e.html)
Nelson wrote:
> thank you jie Liang for your response, but my problems are:
> 1. How to store a query in the database.
> 2. How to give a parameter from outside of database, for example:
> select * from table1 where row1 = my_parameter_outside.
> Give me an example please.
--
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
jliang@ipinc.com
www.ipinc.com
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-sql@postgresql.org
Cc: jliang@ipinc.com, nbrito@cmet.net, pgsql-general@hub.org, pgsql-novice@hub.org, pgsql-sql@hub.org
Subject: Re: how to store a query, that results in a table
In-Reply-To: <39CBDC90.7E4700DC@ipinc.com>
References: <39CB65A0.9DEF7ABB@cmet.net> <39CBD205.9A922DDE@ipinc.com> <39CBD883.9A63F0C6@cmet.net> <39CBDC90.7E4700DC@ipinc.com>
* 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