Re: how to store a query, that results in a table

From: Jie Liang <jliang(at)ipinc(dot)com>
To: Nelson <nbrito(at)cmet(dot)net>
Cc: "pgsql-general(at)hub(dot)org" <pgsql-general(at)hub(dot)org>, "pgsql-novice(at)hub(dot)org" <pgsql-novice(at)hub(dot)org>, "pgsql-sql(at)hub(dot)org" <pgsql-sql(at)hub(dot)org>
Subject: Re: how to store a query, that results in a table
Date: 2000-09-22 22:26:24
Message-ID: 39CBDC90.7E4700DC@ipinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

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(at)ipinc(dot)com
www.ipinc.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris 2000-09-22 22:36:53 users
Previous Message Nelson 2000-09-22 22:09:07 [SQL] how to store a query, that results in a table

Browse pgsql-novice by date

  From Date Subject
Next Message Keith Wong 2000-09-23 01:14:29 Re: how to store a query, that results in a table
Previous Message Nelson 2000-09-22 22:09:07 [SQL] how to store a query, that results in a table

Browse pgsql-sql by date

  From Date Subject
Next Message Keith Wong 2000-09-23 01:14:29 Re: how to store a query, that results in a table
Previous Message Nelson 2000-09-22 22:09:07 [SQL] how to store a query, that results in a table