How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters

From: Néstor Boscán <nestorjb(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters
Date: 2014-10-04 16:16:32
Message-ID: CALyLaQJn+gfd9zhTXwfSC9pqoOaaa+iXNmVReKuQcufC2=7+JQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I have a PL/pgSQL that looks like this:

create or replace function my_function (p_cursor out refcursor, p_code out
varchar, p_message out varchar) as $$
begin
open p_cursor for
select * from table;

p_code := 'AJ001';

return;
end; $$ language plpgsql;

I've tried to invoke this function using:

cursor.callproc('schema.my_function', [ 'mycursor', code, message ])

But I get:

HINT: Ninguna funci├│n coincide en el nombre y tipos de argumentos. Puede
ser necesario agregar conversión explícita de tipos.

In english is something like No function matches the name and types of
arguments.

Any ideas?

Regards,

Néstor

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-10-04 16:51:28 Re: How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters
Previous Message Andy Colson 2014-10-04 14:06:13 Re: Really strange foreign key constraint problem blocking delete