agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Praveen Mamnani <pmamnani@cs.nmsu.edu>
To: postgres@postgres.Berkeley.EDU
Cc: pmamnani@nmsu.edu
Subject: retrieve in libpq
Date: Fri, 14 Oct 1994 17:27:25 -0600 (MDT)
Message-ID: <Pine.3.89.9410141747.A19323-a200000@boron> (raw)




I had some embedded SQL programs that I was converting to PQL,

In SQL one can do a SELECT <field name>. In PQL one can retrieve a
field in a similar manner :

retrieve (result = EMP.salary)
      where EMP.name = "Bill" \g

But when using libpq, executing such simpler queries is not easy.
One has to get the instance in a portal buffer then apply some more
functions (such as PQnfields(), PQgetvalue(), etc.) to get to that
particular field (EMP.salary), for that particular employer "Bill".

So every time when I have to retrieve a specific field in a class, I
have to go through this process, instead of just specifying the field
name and the "where" condition (as done in monitor).

	In the programs that I am converting I have many-many retrieve
statements, and for each retrieve, I will have to go through all this 
process for each different field in a different class. Is there
another way or an easier way to do such retrieve statments when using libpq?

your help would be greatly appriciated.

Praveen.





Attachments:

  [text/plain] libpq (1.0K, 2-libpq)
  download | inline:


I had some embedded SQL programs that I was converting to PQL,

In SQL one can do a SELECT <field name>. In PQL one can retrieve a
field in a similar manner :

retrieve (result = EMP.salary)
      where EMP.name = "Bill" \g

But when using libpq, executing such simpler queries is not easy.
One has to get the instance in a portal buffer then apply some more
functions (such as PQnfields(), PQgetvalue(), etc.) to get to that
particular field (EMP.salary), for that particular employer "Bill".

So every time when I have to retrieve a specific field in a class, I
have to go through this process, instead of just specifying the field
name and the "where" condition (as done in monitor).

	In the programs that I am converting I have many-many retrieve
statements, and for each retrieve, I will have to go through all this 
process for each different field in a different class. Is there
another way or an easier way to do such retrieve statments when using libpq?

your help would be greatly appriciated.

Praveen.




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 using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: pmamnani@cs.nmsu.edu, pmamnani@nmsu.edu
  Subject: Re: retrieve in libpq
  In-Reply-To: <Pine.3.89.9410141747.A19323-a200000@boron>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox