Re: error using pl/pgsql? [possibly off topic]

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: error using pl/pgsql? [possibly off topic]
Дата
Msg-id 20011123105130.F84165-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на error using pl/pgsql? [possibly off topic]  ("Johnny Jørgensen" <pgsql@halfahead.dk>)
Ответы Re: error using pl/pgsql? [possibly off topic]  ("Johnny J\xF8rgensen" <pgsql@halfahead.dk>)
Список pgsql-general
On Fri, 23 Nov 2001, [ISO-8859-1] "Johnny J�rgensen" wrote:

A few notes **ed below.

> CREATE FUNCTION new_order(text,text)
> RETURNS text
> AS '
>  DECLARE
>   p_id ALIAS FOR $1;
>   p_date ALIAS FOR $2;
>   ret_val text;
>  BEGIN
>   BEGIN WORK;
** can't put transaction statements in I think to start.
** Take out the begin work and commit work.

>    INSERT INTO ordre (person_id,placement_date,status) VALUES (p_id::int4,p_date::decimal,1);
** I don't think there's a text->decimal conversion defined.  Why is the
** parameter defined as text anyway?

>    SELECT currval(ordre_id_seq::text) INTO ret_val;
** I think you really want ''ordre_id_eq'' since otherwise
** its looking for a parameter or column name,
** and do you really want this back as text rather than
** the integer type currval normally returns?

>   COMMIT WORK;
>   RETURN ret_val;
>  END;
> '
> LANGUAGE 'plpgsql';


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

Предыдущее
От: William WAISSE
Дата:
Сообщение: Re: newbie needs help with postgres internal tables
Следующее
От: Luis Amigo
Дата:
Сообщение: explain analyze