Re: How return a row from a function so it is recognized as such by caller?
От | Kenneth Tilton |
---|---|
Тема | Re: How return a row from a function so it is recognized as such by caller? |
Дата | |
Msg-id | CAECCA8a36c0Q_jqj082sj8_+PKLK=5h1ysp-XKX08__KKCYQBQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: How return a row from a function so it is recognized as such by caller? (Merlin Moncure <mmoncure@gmail.com>) |
Ответы |
Re: How return a row from a function so it is recognized as
such by caller?
|
Список | pgsql-general |
On Wed, Mar 28, 2012 at 3:40 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
On Wed, Mar 28, 2012 at 2:08 PM, Kenneth Tilton <ktilton@mcna.net> wrote:your'e missing a 'select' in there. functions must be called through
> Thanks, Merlin. Maybe I have some subtle detail wrong. When
> NEW.warn_time_init is 'now_plus_30' and I have this as my execute statement:
>
> execute NEW.warn_time_init || '($1)' into bpa using NEW;
>
> ...I get:
>
select (just like you can't call a function by name in psql without
it).
Well then I have the other error. With this code:
execute 'select ' || NEW.warn_time_init || '($1)' into bpa using NEW;
I get:
NOTICE: bpa inbound (,now_plus_30)
CONTEXT: SQL statement "select now_plus_30($1)"
PL/pgSQL function "bp_alert_init" line 6 at EXECUTE statement
NOTICE: warn time in input row = ("2012-04-27 19:04:37.793835+00",now_plus_30)
CONTEXT: SQL statement "select now_plus_30($1)"
PL/pgSQL function "bp_alert_init" line 6 at EXECUTE statement
ERROR: invalid input syntax for type timestamp with time zone: "("2012-04-27 19:04:37.793835+00",now_plus_30)"
CONTEXT: PL/pgSQL function "bp_alert_init" line 6 at EXECUTE statement
********** Error **********
ERROR: invalid input syntax for type timestamp with time zone: "("2012-04-27 19:04:37.793835+00",now_plus_30)"
SQL state: 22007
Context: PL/pgSQL function "bp_alert_init" line 6 at EXECUTE statement
I guess you are right, though. This is the error I have to resolve.
Thx,
-kt
В списке pgsql-general по дате отправления: