From: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
To: Matej.PgODBC@Neosys <pgodbc@matej.neosys.si>
Cc: pgsql-odbc@postgresql.org
Subject: Re: PGAPI_ProcedureColumns and no support for table output arguments
Date: Fri, 21 Apr 2017 22:30:14 +0900
Message-ID: <8fe50706-e45c-06cf-d171-e390a684e0ac@dream.email.ne.jp> (raw)
In-Reply-To: <20170421085303.354f6dc7d07a9dc333c49245@matej.neosys.si>
References: <20170413050855.5ebf44f66be3bbc784a1ff87@matej.neosys.si>
<3b3d5716-761f-22ff-2f7b-8c67b2e30ae0@dream.email.ne.jp>
<20170421085303.354f6dc7d07a9dc333c49245@matej.neosys.si>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
Hi Matej,
On 2017/04/21 15:53, Matej.PgODBC@Neosys wrote:
> On Wed, 19 Apr 2017 15:35:23 +0900
> "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp> wrote:
>
>> Hi,
>>
>> On 2017/04/13 12:08, Matej.PgODBC@Neosys wrote:
>>> Hi Everyone,
>>>
>>> While debugging the driver, I've noticed that there is no support for table output arguments (proargmodes = 't').
>>>
>>> Is this intentional or is it a simple omission or even a bug?
>> When SQLProcedureColumns() was implemented, table output arguments did
>> not exist.
>> Unfortunately I've not known table output arguments.
>> Is it OK to interpret them as OUT parameters?
> Good morning Hiroshi,
>
> I think the appropriate mapping for the table output columns is SQL_RESULT_COL.
>
> I am slightly confused why an additional column with no name and type SQL_RESULT_COL is being reported with procedures returning table results. I would expect an additional SQL_RETURN_VALUE field, but what I am seeing is like a duplication of one, perhaps the last one, of the output table's columns.
OK, how about the attached patch?
regards,
Hiroshi Inoue
> We are still in the process of validating this change. The first results with our application are positive, but we haven't made any systematic tests.
>
> Regards,
> Matej.
>> regards,
>> Hiroshi Inoue
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbcAttachments:info.patch (text/x-diff, 1.0K) downloaddiff --git a/info.c b/info.cindex 76bcedd..1b87665 100644--- a/info.c+++ b/info.c@@ -5106,7 +5106,8 @@ mylog("atttypid=%s\n", atttypid ? atttypid : "(null)");
switch (*proargmodes)
{
case 'o':
- ptype = SQL_PARAM_OUTPUT;+ case 't':+ ptype = bRetset ? SQL_RESULT_COL : SQL_PARAM_OUTPUT;
break;
case 'b':
ptype = SQL_PARAM_INPUT_OUTPUT;
@@ -5138,20 +5139,12 @@ mylog("atttypid=%s\n", atttypid ? atttypid : "(null)");
}
}
/* RESULT Columns info */
- if (NULL != atttypid || bRetset)+ if (NULL != atttypid && !bRetset)
{
int typid;
- if (bRetset)- {- typid = pgtype;- attname = NULL;- }- else- {- typid = atoi(atttypid);- attname = QR_get_value_backend_text(tres, i, attname_pos);- }+ typid = atoi(atttypid);+ attname = QR_get_value_backend_text(tres, i, attname_pos);
tuple = QR_AddNew(res);
set_tuplefield_string(&tuple[PROCOLS_PROCEDURE_CAT], CurrCat(conn));
set_nullfield_string(&tuple[PROCOLS_PROCEDURE_SCHEM], schema_name);
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: h-inoue@dream.email.ne.jp, pgodbc@matej.neosys.si
Subject: Re: PGAPI_ProcedureColumns and no support for table output arguments
In-Reply-To: <8fe50706-e45c-06cf-d171-e390a684e0ac@dream.email.ne.jp>
References: <20170413050855.5ebf44f66be3bbc784a1ff87@matej.neosys.si> <3b3d5716-761f-22ff-2f7b-8c67b2e30ae0@dream.email.ne.jp> <20170421085303.354f6dc7d07a9dc333c49245@matej.neosys.si> <8fe50706-e45c-06cf-d171-e390a684e0ac@dream.email.ne.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox