Re: How to successfully create a new function?

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: How to successfully create a new function?
Дата
Msg-id 20120403170606.GA11098@tux
обсуждение исходный текст
Ответ на How to successfully create a new function?  (Jim Moon <moonjamesg@gmail.com>)
Список pgsql-novice
Jim Moon <moonjamesg@gmail.com> wrote:

> plpgsql is installed.  Thank you all for the pointers.
>
> This query:
>
> CREATE OR REPLACE FUNCTION "sp_SetScenario"(scen character varying) RETURNS
> void AS
> $BODY$DECLARE
>     sqlStatement VARCHAR(500);
> BEGIN
>     SET sqlStatement = 'ALTER USER postgres WITH DEFAULT_SCHEMA = ' + $1;
>     EXEC(sqlStatement);

String-Concatination? Don't use +, use || instead.



Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: Jim Moon
Дата:
Сообщение: How to connect to remote instance?
Следующее
От: Jim Moon
Дата:
Сообщение: Re: How to successfully create a new function?