Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1Yed-0006rB-EP for pgsql-odbc@arkaria.postgresql.org; Fri, 21 Apr 2017 13:31:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d1Yec-0004x2-VS for pgsql-odbc@arkaria.postgresql.org; Fri, 21 Apr 2017 13:31:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d1YeE-0003sM-W2 for pgsql-odbc@postgresql.org; Fri, 21 Apr 2017 13:30:55 +0000 Received: from mail3.asahi-net.or.jp ([202.224.39.205]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1YeA-0003wU-JO for pgsql-odbc@postgresql.org; Fri, 21 Apr 2017 13:30:54 +0000 Received: from [192.168.1.5] (aa029213.dynamic.ppp.asahi-net.or.jp [110.5.29.213]) (Authenticated sender: GQ9H-INUE) by mail3.asahi-net.or.jp (Postfix) with ESMTPA id A903E57645; Fri, 21 Apr 2017 22:30:12 +0900 (JST) Subject: Re: PGAPI_ProcedureColumns and no support for table output arguments To: "Matej.PgODBC@Neosys" References: <20170413050855.5ebf44f66be3bbc784a1ff87@matej.neosys.si> <3b3d5716-761f-22ff-2f7b-8c67b2e30ae0@dream.email.ne.jp> <20170421085303.354f6dc7d07a9dc333c49245@matej.neosys.si> Cc: pgsql-odbc@postgresql.org From: "Inoue, Hiroshi" Message-ID: <8fe50706-e45c-06cf-d171-e390a684e0ac@dream.email.ne.jp> Date: Fri, 21 Apr 2017 22:30:14 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170421085303.354f6dc7d07a9dc333c49245@matej.neosys.si> Content-Type: multipart/mixed; boundary="------------C7AD91A40E9B686A9783FE65" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org This is a multi-part message in MIME format. --------------C7AD91A40E9B686A9783FE65 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi Matej, On 2017/04/21 15:53, Matej.PgODBC@Neosys wrote: > On Wed, 19 Apr 2017 15:35:23 +0900 > "Inoue, Hiroshi" 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 --------------C7AD91A40E9B686A9783FE65 Content-Type: text/x-diff; name="info.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="info.patch" diff --git a/info.c b/info.c index 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); --------------C7AD91A40E9B686A9783FE65 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc --------------C7AD91A40E9B686A9783FE65--