Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id PAA20029 for postgres-redist; Mon, 3 Oct 1994 15:39:05 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199410032239.PAA20029@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from motgate.mot.com (motgate.mot.com [129.188.136.100]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id PAA20019 for <postgres@nobozo.CS.Berkeley.EDU>; Mon, 3 Oct 1994 15:39:04 -0700
Received: from pobox.mot.com ([129.188.137.100]) by motgate.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <postgres@nobozo.CS.Berkeley.EDU>)
          id AA29253; Mon, 3 Oct 1994 17:38:30 -0500
Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com) by pobox.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <postgres@nobozo.CS.Berkeley.EDU>)
          id AA04678; Mon, 3 Oct 1994 17:38:28 -0500
Received: by mdd.comm.mot.com (4.1/SMI-4.1)
	id AA14527; Mon, 3 Oct 94 15:38:24 PDT
Message-Id: <9410032238.AA14527@mdd.comm.mot.com>
Date: Mon, 3 Oct 1994 15:36 PDT
From: "WEIX%PTHWRK.allin1"@puget.com
To: postgres@postgres.Berkeley.EDU
Subject: Questions on Virtual Attributes....
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Mon, 03 Oct 94 15:39:05 -0700
Resent-XMts: smtp

From:	NAME: Xinguo Wei                    
	FUNC:                                 
	TEL:                                  <WEIX AT A1 AT PTHWRK>
To:	smtp%"postgres@nobozo.CS.Berkeley.EDU"@mrgate


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

 weix@puget.com


==============================================================================
   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.
==============================================================================
