Support for CALL statement in ecpg

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, peter_e(at)gmx(dot)net, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Support for CALL statement in ecpg
Date: 2019-07-18 11:08:54
Message-ID: CAE9k0PkKCsbZLurU5O5V3+c1F-ANKFoKpzpMUa6LQFP9+dcJFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi All,

In the current code for ecpg, we can't use CALL statement to call
stored procedures. The attached patch adds the support for it.

With the attached patch, we can now have the following SQL statement
in ecpg application to call the stored procedures with IN or INOUT
params.

EXEC SQL CALL SP1(:hv1, :hv2);

Additionally, we can also use indicator variables along with the
arguments of stored procedure with CALL statement like shown below:

EXEC SQL CALL SP1(:hv1 :ind1, :hv2, :ind2);

The patch also adds some basic test-cases to verify if CALL statement
in ecpg can be used to call stored procedures with different type of
parameters.

Please have a look and let me know your thoughts.

Thank you.

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

Attachment Content-Type Size
v1-support-for-CALL-stmt-ecpg.patch text/x-patch 10.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2019-07-18 11:10:06 Re: d25ea01275 and partitionwise join
Previous Message Etsuro Fujita 2019-07-18 11:00:45 Re: partition routing layering in nodeModifyTable.c