| От | Richard Broersma Jr |
|---|---|
| Тема | Re: Passing Parameters To Command Scripts |
| Дата | |
| Msg-id | 327337.5819.qm@web31810.mail.mud.yahoo.com обсуждение исходный текст |
| Ответ на | Passing Parameters To Command Scripts ("Duncan Garland" <duncan.garland@ntlworld.com>) |
| Список | pgsql-novice |
> I'm in the process of converting some Oracle SQL scripts to Postgres. Many > of the scripts accept arguments along the following > lines: > > @tmp.sql fred > > I can't find the Postgres equivalent. > > This works from outside Postgres: > > psql -f tmp.sql -v arg1=fred > > This works from within psql > > \set arg1 fred > \i tmp.sql > \unset arg1 > > But the following all fail > > \i tmp.sql fred > \i tmp.sql arg1=fred > \i tmp.sql -v arg1=fred > > Can anyone help? What is the correct syntax? I would be enterested in see a way to pass arguements to a sql script as well. However this link might help to you do what you want: http://www.postgresql.org/docs/8.1/interactive/xfunc-sql.html Regards, Richard Broersma Jr.
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера