agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: SRIRAMK@charlie.usd.edu
To: postgres@postgres.Berkeley.EDU
Cc: SRIRAMK@charlie.usd.edu
Subject: Error in using GetAttributeByName in a function
Date: Sun, 4 Dec 1994 14:53:39 -0600 (CST)
Message-ID: <941204145339.26149@charlie.usd.edu> (raw)



I had sent the following requesting help a week ago. I havent had  any
response -I badly need help.

My function given below doesn't work.  

/*  method_folder.c  - to retrieve tuples with fldrname = "DEFAULT" */

#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;
    folder_name = (char *) malloc (100);

    strcpy(folder_name, (char *) GetAttributeByName(t,"fldrname"));
    printf ("FOLDER NAME %s\n",folder_name);
    if (!(strcmp(folder_name,"DEFAULT")))  
       return (1);
    else
       return (0);
}


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

The error message I get is : 

Welcome to the C POSTGRES terminal monitor

Go 
* 
Query sent to backend is "retrieve (FOLDERS.all) where method_folder(FOLDERS) "
WARN:Nov 26 20:44:22:GetAttributeByName: a NULL isNull flag was passed
sed


Go 


Any suggestions would be appreciated.

Thanks,

Sriram Kal.

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



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: SRIRAMK@charlie.usd.edu
  Subject: Re: Error in using GetAttributeByName in a function
  In-Reply-To: <941204145339.26149@charlie.usd.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