Re: Question about stored procedures

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Question about stored procedures
Дата
Msg-id 20060612091528.GC30300@webserv.wug-glas.de
обсуждение исходный текст
Ответ на Question about stored procedures  ("Greg" <greg@officium.co.za>)
Ответы Re: Question about stored procedures  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice
am  12.06.2006, um 10:58:04 +0200 mailte Greg folgendes:
> >From what I understand, a stored procedure in pgSQL is actually a function
> that returns rows? Am I correct?

Yes and no, if a function returns multiple rows, than is this a SRF (Set
Returning Function)

http://www.postgresql.org/docs/current/static/xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS
http://www.varlena.com/GeneralBits/26


>
>  Can somebody show me the syntax for a basic stored procedure that takes an
> argument?

http://www.postgresql.org/docs/8.1/interactive/plpgsql-declarations.html
there are examples. Read this.


> i.e I would like the query to be "select name, email from users where userid
> = @userid"

If you want to execute dynamic querys, read

http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN


> Sorry for the easy question but I looked at the docs and just can't seem to

Read again.


Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: Easy SQL Question
Следующее
От: Devrim GUNDUZ
Дата:
Сообщение: Re: Easy SQL Question