How to pass multiple arguments in spi_prepare?

Поиск
Список
Период
Сортировка
От paresh masani
Тема How to pass multiple arguments in spi_prepare?
Дата
Msg-id a9d94e070910050617p40e93c06o95dacb0b2dc7077b@mail.gmail.com
обсуждение исходный текст
Список pgsql-novice
Hi,

Could anyone please help with my simple question? I understood below
spi_prepare and spi_exec_prepared example given in PostgreSQL
documentation.

CREATE OR REPLACE FUNCTION init() RETURNS INTEGER AS $$
    $_SHARED{my_plan} = spi_prepare( ’SELECT (now() + $1)::date AS now’,
’INTERVAL’);
$$ LANGUAGE plperl;

CREATE OR REPLACE FUNCTION add_time( INTERVAL ) RETURNS TEXT AS $$
    return spi_exec_prepared(
        $_SHARED{my_plan},
        $_[0],
    )->{rows}->[0]->{now};
$$ LANGUAGE plperl;

CREATE OR REPLACE FUNCTION done() RETURNS INTEGER AS $$
    spi_freeplan( $_SHARED{my_plan});
    undef $_SHARED{my_plan};
$$ LANGUAGE plperl;

Could you tell me what could what could be the spi_prepare command and
argument for below query?

INSERT INTO myschema.mytable ("col1", "col2") VALUES (100,200);

Thanks,
Paresh

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Installation on Windows 2003 fails
Следующее
От: Tom Holderness
Дата:
Сообщение: psql in bash - how to clear screen?