Re: how to store a query, that results in a table
От | Jie Liang |
---|---|
Тема | Re: how to store a query, that results in a table |
Дата | |
Msg-id | 39CBDC90.7E4700DC@ipinc.com обсуждение исходный текст |
Ответ на | how to store a query, that results in a table (root <nbrito@cmet.net>) |
Список | pgsql-sql |
Hi, <br />So, your question is not client side, <br />you want store a procedure in db(server side) can accept para fromclient side. <br />I have not seen Pg has a functionality to do like store procedure or package like Oracle <br />( maybeI don't know), so , I suggest that : <br />1 use embeded SQL <br />2. store query as a SQL in shell script( becauseshell script can accept parameters) <br /> in shell , you can say: <br /> echo "select * from table1 where row1=$1"|rshpg_server /usr/local/pgsql/bin/psql -U robt db <br /> (e.g . remote shell call, local is same) <br />3. ifyou use bash shell, you can also use pgbash(<a href="http://www.psn.co.jp/PostgreSQL/pgbash/index-e.html)">http://www.psn.co.jp/PostgreSQL/pgbash/index-e.html)</a><p>Nelson wrote:<blockquote type="CITE">thank you jie Liang for your response, but my problems are: <br />1. How to store a query inthe database. <br />2. How to give a parameter from outside of database, for example: <br />select * from table1 whererow1 = my_parameter_outside. <br />Give me an example please.</blockquote><pre>-- 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</pre>
В списке pgsql-sql по дате отправления: