Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXj4I-0007yW-0K for pgsql-general@arkaria.postgresql.org; Wed, 28 Oct 2020 10:52:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXj4G-00066w-VJ for pgsql-general@arkaria.postgresql.org; Wed, 28 Oct 2020 10:52:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXiL4-0005D6-0L for pgsql-general@lists.postgresql.org; Wed, 28 Oct 2020 10:05:54 +0000 Received: from mail-eopbgr1380098.outbound.protection.outlook.com ([40.107.138.98] helo=IND01-MA1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXiKz-0008IA-Ro for pgsql-general@lists.postgresql.org; Wed, 28 Oct 2020 10:05:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4BdSPDRiMRNdjaMWH21AnNEvULqEMBbG0j+1Us8zhL1ds2ulpd/FFoV09ABDxMmoTX3q//y53P70KTLEceOYeWVyh/92E2svPNY06BYGl8iNxrrQOD+OKozlXcY4iNh2w2MEvdfQbi0jcxbLPM2Z26alyY3Y9zKe/vuZ86FA+HQku5WH9TMethIwKWW0HYFipuMxMQMGTFA1sNe6gq+y8zZBST8SzIbU5Sp13/HFgxHNZGTX80wGD9Fcm2hwf+Ge71HdGKxUTavRYh1x/kU8ajQDQZ6c7hfilzsVDgI98zW4Lupe4JMdgTVKnHmIznb3mcZ7ciWGjZzVfiA7Ek2kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yjOlYZYRJaLg9aIgXWF5Hf9gPFsuykwmJTRW5eLMpsw=; b=kE2X4ql5FfboTnHxGF8aQYsXiSO/3kKjlwOwiEYUMtUzJTQX9s2UBUPMDB3893qGFUV8kvD8SAqe8RDpDYRlBcFwIEcs43mGX45TP4RgSADg+dFHJ9Oi5QDIYnueIGHV/C7+ZpIec71mUPJNdFe92vlvSdzyLenlGPNt7xEODcXENNjvGY7jDQzxrd579m0VBNef7EtKJuEfmx0Vw0DIwg9Y6QsGT2cNJths2i3GzxlVzZRP2XwQT6/LrwemgbxFI5BQo20NiDPsg7OhkFUdRjPJ2cRxKMC14Hl39oApFbarMAq0aBWbsgM8rfVD2ONeDy7aQ3QDSu0/j5EEp/TWcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=xius.com; dmarc=pass action=none header.from=xius.com; dkim=pass header.d=xius.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=megasoftltd.onmicrosoft.com; s=selector2-megasoftltd-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yjOlYZYRJaLg9aIgXWF5Hf9gPFsuykwmJTRW5eLMpsw=; b=XmNA/gjXX1T36g/vCq6lEVFgxipEyiJA1p8Uz8VcQiD4HNsyDz0bsQD+afS13irnPTERRCmQ46n04M5dQN4lShYL0AiEU/pLldTkpDSXnZzSbB+5bTG7jZOVQ8eAwnIs/+6E2UE2MtH4as0oYl91CQDqozer74C09Ek97th5jos= Received: from MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:62::17) by MAXPR01MB3311.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Wed, 28 Oct 2020 10:05:44 +0000 Received: from MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM ([fe80::1d9e:8e3e:c90e:a59a]) by MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM ([fe80::1d9e:8e3e:c90e:a59a%5]) with mapi id 15.20.3499.018; Wed, 28 Oct 2020 10:05:44 +0000 From: Mahesh Bodepati To: Laurenz Albe , "pgsql-general@lists.postgresql.org" Subject: Re: facing problem in outparameters in c Thread-Topic: facing problem in outparameters in c Thread-Index: AQHWq4QWpetb4fui4UiYzQyVCpK+zqmrhtWAgADrQCyAACaXgIAAMfHK Date: Wed, 28 Oct 2020 10:05:44 +0000 Message-ID: References: ,<18919421f0e39276ca3f66883a2976500f26f95f.camel@cybertec.at> ,<2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at> In-Reply-To: <2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: cybertec.at; dkim=none (message not signed) header.d=none;cybertec.at; dmarc=none action=none header.from=Xius.com; x-originating-ip: [2409:4070:702:9cd6:a09e:51ca:ec8:ebe7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0b73eb99-0b35-4a7d-b2f5-08d87b290902 x-ms-traffictypediagnostic: MAXPR01MB3311: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lpBWzZOmwuK+ntA26KnaXggEdrrgwQ8Vj8+GNa5Dvkpitc9ohujkJYs2Rny8twsyikc+u9mfUJ1kg2vy/ZIJAeqxJzV81fXSKIw++y2EjYkr55cACuYA8qqRw182a/y8KtxnEgA8I0ZOwyUXdYH6iLoOu469dkiw8+pOYlMCpEV6ngktTma7Iq4pRXDS6yUo4QL2DedbDdSIlP/ch5CvhBovCUyXIi7r8I1iEGWoJ7Mi1WFgwH/npX/kn/YJQPcMxIeI3hVl+l1355+zw8ZMf2JXMSUoRt/qsXXA5MJy07S4lV8GO+c12r+qIKiXU8vDBKg3EWo13Owrn9hJEuIoP0j3lsVmScNi+tALv05KxSAoNQTzPpSTf1h0SLOCx/fP8bQk/SrRQpfHxZZ1pLU+Tiy5wnZqVcjX+/kHpWPefDvlGb3iRXhRqG9pgQmpjxKQ76/zrRrs/3TqNSAibsUSDw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(39840400004)(346002)(396003)(376002)(366004)(136003)(52536014)(6506007)(9686003)(5660300002)(186003)(316002)(53546011)(71200400001)(8936002)(44832011)(478600001)(966005)(2906002)(19627405001)(66446008)(55016002)(110136005)(33656002)(66556008)(4001150100001)(166002)(8676002)(76116006)(86362001)(66476007)(64756008)(66946007)(7696005)(129723003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: KwEW0jGatWq/Bb89LdWPjWkrx+oilUOdW+nqgVwTzMHEr7NhVMW9SqynyWqZFmmVU5evXe64PAev8A2asvdZTPYSt0HLnKm3OB76G+KgEvvqBKjP/dnJIuaX8bmoXDALhi24S5OVd2Hn2tdO/Sj5azpHX92/krrDwBVKCQwAZDIv37oJTuO2UeoLKgiZ2u0LqEdTWszdcPhtH6ltBXO2PT+Ujqa1q5uyG7gc5tYv5o9euqqSdW8bqvRyBHuTc18lydTq4CsAoaCGjw0xKZmqjIKlCzsqhcPQzZ1rZqX6yr9y2DfrpbjumnnlxqiWXvlRwWeFE9K7hoci6L5zuv+YEcavgZK7fy/eqErUkVZ4K77P6kElOPZJwdCMHJg41myGmbCyw48M5O/wbzPqyZGCaEg8DvFm4cWQVEzHH/fAuJB38dZjkyvaQ18YvU5wyeBYN41wSuxJ3TehuDyWE3jUf6zt6KlUUOSh+irPBlVvSMsl788QL+zwECixDtbvRVb0ngtV+E+XhSby9xo68ZZdz7QpPNwOTj6jqGU4iwaij7TiatjU16XQkzSruks2U7QOxJ6fBKSyOL3X1dGuTIF739xgO/ud/IAWnxZkhHrTMPxLjLn1WtjEL7JHqaVi7+YibJt5XTYn7C4fep+DA9qhXxrr50uDHRtcoPciz2gkCvJ5Ut9QkwZYkUCqtf+EpHSqKbx7HBKBaog9xRrI/Bw+Aw== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_MAXPR01MB3647EA409E3A2B5C23AE0CB096170MAXPR01MB3647INDP_" MIME-Version: 1.0 X-OriginatorOrg: Xius.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 0b73eb99-0b35-4a7d-b2f5-08d87b290902 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2020 10:05:44.7342 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e32b57-c2cb-4cfb-9748-dc0a0bc1150a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KyO+RAlnA+y8V2kl7DnNgCkVfj0/AyUtF5wDnXrDg3PHfg2VW0sqTKTxKc+B6RW4Y4qAfKOGZuFrIAtb/dgEiL8VTArz/j5b5OVLivQETsI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MAXPR01MB3311 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_MAXPR01MB3647EA409E3A2B5C23AE0CB096170MAXPR01MB3647INDP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable whatever you said is correct but actually what i want is whenever iam calli= ng the postgres function by passing input and output parameters in c ,aft= er execution of postgres function in database side they will return output= paramers .after that when i print the output variable name i need that out= put parameter value diretcly without differenciating with column names. Thanks & Regards, Mahesh Bodepati Software Engineer- Engineering XIUS INNOVATE . LEAD. mahesh.bodepati@xius.com http://www.xius.com ________________________________ From: Laurenz Albe Sent: Wednesday, October 28, 2020 12:29 PM To: Mahesh Bodepati ; pgsql-general@lists.postgre= sql.org Subject: Re: facing problem in outparameters in c On Wed, 2020-10-28 at 04:57 +0000, Mahesh Bodepati wrote: > Actually i am calling a postgres function by using c language which des= cription > is defined in database side .when iam calling a postgres function by pas= sing input > and output parameters after excution of function in database side i need= output > data in correcsponding output parameters but iam not getting output like= that. Right; output parameters in a function are columns in the result set. > i am getting total output data in response pointer.if iam getting total = data > in response pointer it is hard to figure out which data is for which ou= tput parameter. No, that is very simple. You can call PQfnumber on the result set to find = which position in the result set belongs to a certain parameter name. See https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-EXEC-SELE= CT-INFO > can you please check once attached two text files. I looked, and the C code is unreadable. You seem to be mixing embedded SQL and libpq calls, which you shouldn't. There is great value in a consistent indentation style. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com --_000_MAXPR01MB3647EA409E3A2B5C23AE0CB096170MAXPR01MB3647INDP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
whatever you said is correct but actually what i want is whenever iam calli= ng the  postgres function by passing input and output parameters = in c ,after execution of postgres function in database side they will = ; return output paramers .after that when i print the output variable name i need that output parameter value diretcly witho= ut differenciating  with column names.



<= /font>
Thanks <= b>& Regards,
Mahesh Bodepati
Software Engineer- Engineering
XIUS


From: Laurenz Albe <laur= enz.albe@cybertec.at>
Sent: Wednesday, October 28, 2020 12:29 PM
To: Mahesh Bodepati <mahesh.bodepati@Xius.com>; pgsql-general@= lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: facing problem in outparameters in c
 
On Wed, 2020-10-28 at 04:57 +0000, Mahesh Bodepati= wrote:
> Actually i am calling a postgres function by using c language  wh= ich  description
>  is defined in database side .when iam calling a postgres functio= n by passing input
>  and output parameters after excution of function in database sid= e i need output
> data in correcsponding  output parameters but iam not getting out= put like that.

Right; output parameters in a function are columns in the result set.

>  i am getting total output data in response pointer.if iam gettin= g total data
>  in response pointer it is hard to figure out which data  is= for which output parameter.

No, that is very simple.  You can call PQfnumber on the result set to = find which
position in the result set belongs to a certain parameter name.

See https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-EXEC-SELECT-I= NFO

>  can you please check once attached two text files.

I looked, and the C code is unreadable.
You seem to be mixing embedded SQL and libpq calls, which you shouldn't. There is great value in a consistent indentation style.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybe= rtec-postgresql.com

--_000_MAXPR01MB3647EA409E3A2B5C23AE0CB096170MAXPR01MB3647INDP_--