Return-Path: owner-postman Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id CAA17166 for postgres-redist; Sat, 13 May 1995 02:02:30 -0700 Resent-From: POSTGRES mailing list Resent-Message-Id: <199505130902.CAA17166@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.10/8.6.3) with ESMTP id CAA17156 for ; Sat, 13 May 1995 02:02:28 -0700 Received: from pobox.mot.com (pobox.mot.com [129.188.137.100]) by motgate.mot.com (8.6.11/8.6.10/MOT-3.6) with ESMTP id EAA24427 for ; Sat, 13 May 1995 04:01:56 -0500 Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com [138.242.64.201]) by pobox.mot.com (8.6.11/8.6.10/MOT-3.6) with SMTP id EAA17039 for ; Sat, 13 May 1995 04:01:55 -0500 Received: by mdd.comm.mot.com (4.1/SMI-4.1) id AA01234; Sat, 13 May 95 02:01:43 PDT Message-Id: <9505130901.AA01234@mdd.comm.mot.com> Received: from nordic.puget.com by puget.puget.com; (5.65/1.1.8.2/12Dec94-0553PM) id AA10286; Sat, 13 May 1995 01:57:11 -0700 Date: Sat, 13 May 1995 01:58 PDT From: WEIX@puget.com To: postgres@postgres.Berkeley.EDU Subject: how to read array type? X-Vms-To: SMTP%postgres@nobozo.CS.Berkeley.EDU Resent-To: postgres-redist@postgres.Berkeley.EDU Resent-Date: Sat, 13 May 95 02:02:30 -0700 Resent-XMts: smtp From: NAME: Xinguo Wei FUNC: TEL: To: smtp%postgres@nobozo.CS.Berkeley.EDU@mrgate Hi everybody, I defined a class which includes an array type: customer ( meter_reading = int4[],....); The meter_reading will be populated by twelve monthly readings. I also defined some functions on the customer class. However, I am having some troubles to read the meter_reading attribute by using the call GetAttributeByName(). I tried the following but it didn't work properly. typedef int4 int_array[12]; float8 *get_demand_kwh(t) TUPLE t; { ..... int_array *meter_reading; meter_reading = (int_array *) GetAttributeByName(t,meter_reading, &isnull); ..... } I also tried to read individual element by the following statement and Postgres complained about Attribute 'meter_reading[1:1]' not found. one_reading = (int4 *) GetAttributeByName(t,meter_reading[1:1],&isnull); Any suggestions? Xavier ============================================================================== 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. ============================================================================== URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/