Re: how to use pgsql like mssql

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: how to use pgsql like mssql
Дата
Msg-id 695505.80013.qm@web31812.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на how to use pgsql like mssql  (liuzg2@21cn.com)
Список pgsql-sql
--- On Wed, 12/26/07, liuzg2@21cn.com <liuzg2@21cn.com> wrote:

> in the pgadmin edit
> i want use
> declare  ...
> if exists ...
> insert something if @@rowcout>0 then do something
> if ....
> like in mssql and not use function


I take it that you are looking to create stored procedures?  In postgresql they are called "stored functions" or more
correctly"functions."
 

First you will need to load a procedural language into your database if one isn't already installed.
http://www.postgresql.org/docs/8.2/interactive/sql-createlanguage.html

You should probably use PLpgSQL since it is available across OS all platforms and is easy to learn and use.

http://www.postgresql.org/docs/8.2/interactive/plpgsql.html

There are some nice examples in this documentation.

Your PGadmin will also have features to help the create these functions also.

Regards,
Richard Broersma Jr.



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

Предыдущее
От: liuzg2@21cn.com
Дата:
Сообщение: how to use pgsql like mssql
Следующее
От: liuzg2@21cn.com
Дата:
Сообщение: Re: how to use pgsql like mssql