SQL Server stored procedures?

Поиск
Список
Период
Сортировка
От Todd P Marek
Тема SQL Server stored procedures?
Дата
Msg-id 2F2789D4-4270-11D9-A89E-000393823F90@somahq.com
обсуждение исходный текст
Ответы Re: SQL Server stored procedures?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Hello-


I have been trying for a while to write a function that would return
multiple rows and columns in a similar fashion as SQL server stored
procedures.


I can get my functions to return multiple rows and columns but only
from a single table.  I worked around this by creating a view that
ties all my tables together like so (basic example)-><fontfamily><param>Courier</param><x-tad-bigger>


CREATE FUNCTION usp_grab_classes() RETURNS SETOF classes

     AS 'SELECT classes.* FROM classes'

     LANGUAGE 'sql';


</x-tad-bigger></fontfamily>I am curious if there is a way to select
and return multiple columns from multiple tables without having to
first create a view.


Any help would greatly appreciated.


Todd Marek<fontfamily><param>Courier</param><x-tad-bigger>


</x-tad-bigger></fontfamily><italic>"If you think you understand
something it's habit."

--Gary Kraftsow--</italic>
Hello-

I have been trying for a while to write a function that would return
multiple rows and columns in a similar fashion as SQL server stored
procedures.

I can get my functions to return multiple rows and columns but only
from a single table.  I worked around this by creating a view that ties
all my tables together like so (basic example)->

CREATE FUNCTION usp_grab_classes() RETURNS SETOF classes
      AS 'SELECT classes.* FROM classes'
      LANGUAGE 'sql';

I am curious if there is a way to select and return multiple columns
from multiple tables without having to first create a view.

Any help would greatly appreciated.

Todd Marek

"If you think you understand something it's habit."
--Gary Kraftsow--

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: VACUUM and ANALYZE Follow-Up
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Upcoming Changes to News Server ...