Subject: GetAttributeByName for string values

From: [email-masked]
Date: Thu, 8 Dec 1994 1:50:45 -0600 (CST)

Hi, 

My function given below * no longer returns an error * after I used
the third parameter for GetAttributeByName as suggested in response
to my earlier e-mail.  However, GetAttributeByName  does not display
any string attribute values while it successfully does for integer type 
attributes .

Can anybody tell what's wrong ?

The following is a simplified example - it is part of a method that 
returns a bool.

/*  method_folder.c  - to display attribute values */

#include "/home/coyote/postgres/src/backend/tmp/libpq.h"
#include <utils/builtins.h>
#include <tmp/libpq-fe.h>

bool method_folder(t)
TUPLE t;

{
    char folder_name[100];
    bool isnull; 
 
/* Display of a string attribute as below doesn't work */
/* Nothing gets displayed */
  
    printf("Print : %s\n", GetAttributeByName(t,"fldrname",&isnull));

/* Display of an integer attribute with the same syntax as shown below 
    works */
    
    printf("Print cnt: %d\n", (int) GetAttributeByName(t,"msgcnt",&isnull));
}

I used the following command to define the function :

  define function method_folder (language = "c", returntype = bool) arg is 
  (FOLDERS) as "/home/coyote/postgres/final/method_folder.o"  \g

I ran the function with the command :

  retrieve (FOLDERS.all) where method_folder(FOLDERS) \g

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]".
   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/