pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Mahesh Bodepati <mahesh.bodepati@Xius.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: facing problem in outparameters in c
Date: Wed, 28 Oct 2020 07:59:17 +0100
Message-ID: <2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at> (raw)
In-Reply-To: <MAXPR01MB3647DD40F14CF14C84D7139496170@MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM>
References: <MAXPR01MB36478D4B42FF07E5657B068C96190@MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM>
	<18919421f0e39276ca3f66883a2976500f26f95f.camel@cybertec.at>
	<MAXPR01MB3647DD40F14CF14C84D7139496170@MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM>

On Wed, 2020-10-28 at 04:57 +0000, Mahesh Bodepati wrote:
> Actually i am calling a postgres function by using c language  which  description
>  is defined in database side .when iam calling a postgres function by passing 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 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-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






view thread (6+ messages)  latest in thread

Message-ID: <2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at>
Permalink:  ../2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at/
Also on:    postgresql.org/message-id/2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at

 · 

reply

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-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, mahesh.bodepati@Xius.com
  Subject: Re: facing problem in outparameters in c
  In-Reply-To: <2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at>
  References: <MAXPR01MB36478D4B42FF07E5657B068C96190@MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM> <18919421f0e39276ca3f66883a2976500f26f95f.camel@cybertec.at> <MAXPR01MB3647DD40F14CF14C84D7139496170@MAXPR01MB3647.INDPRD01.PROD.OUTLOOK.COM> <2605285663d506f6eec3f0adde25fd251df80227.camel@cybertec.at>

* 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