agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Xinguo Wei <wei@u.washington.edu>
To: postgres@postgres.Berkeley.EDU
Subject: Questions on Virtual Attributes, again!...
Date: Tue, 4 Oct 1994 10:12:59 -0700 (PDT)
Message-ID: <Pine.3.89.9410041029.A73061-0100000@homer10.u.washington.edu> (raw)
In-Reply-To: <9410032238.AA14527@mdd.comm.mot.com>

Hi, 

My email account is having some problems in receiving mail. So I am sending
my question using a diffent account now.  Sorry for the confusion.
---------------------------------------------------------------------------
Hi,

I am testing the virtual attribute function using the SET expression and I have
two questions here.
1. When define the attribute using X = setof Y, the keyword "setof" seems not
necessary if Y is a class name, i.e., "members = EMP" is the same as "members =
setof EMP".  If Y is not a class name, then "setof" is needed.  Am I right?

2. In the following test case, I defined a set attribute for DEPT. But I
couldn't find the way to retrive its value!!  Please help me.

create EMP (name = text, dept = text)\g
create DEPT (name = text, emp_no = setof int4) \g
append EMP (name = "a", dept = "candy")\g
append EMP (name = "b", dept = "candy")\g
append DEPT (name = "candy",
  EMP_no = "retrieve (a = count{EMP.name where EMP.dept = \\"candy\\"})") \g

retrieve (DEPT.name, DEPT.emp_no) \g

Query sent to backend is "retrieve (dept.name, dept.emp_no) "
-----------------------------
| name        | emp_no      |
-----------------------------
| candy       | 25252       |
-----------------------------

 The value of emp_no here looks like an OID. What kind of object is that? How
 can i get the correct value of 2 ?

 Thanks!!

 Xinguo Wei

 wei@u.washington.edu



==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



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: wei@u.washington.edu
  Subject: Re: Questions on Virtual Attributes, again!...
  In-Reply-To: <Pine.3.89.9410041029.A73061-0100000@homer10.u.washington.edu>

* 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