agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
Error in using GetAttributeByName in a function
3+ messages / 2 participants
[nested] [flat]

* Error in using GetAttributeByName in a function
@ 1994-11-27 03:09  SRIRAMK@charlie.usd.edu
  0 siblings, 0 replies; 3+ messages in thread

From: SRIRAMK@charlie.usd.edu @ 1994-11-27 03:09 UTC (permalink / raw)
  To: legacy; +Cc: SRIRAMK@charlie.usd.edu


Hi postgressers, 

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Error in using GetAttributeByName in a function
@ 1994-12-04 20:53  SRIRAMK@charlie.usd.edu
  0 siblings, 1 reply; 3+ messages in thread

From: SRIRAMK@charlie.usd.edu @ 1994-12-04 20:53 UTC (permalink / raw)
  To: legacy; +Cc: SRIRAMK@charlie.usd.edu



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/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Error in using GetAttributeByName in a function
@ 1994-12-04 21:07  Paul M. Aoki <aoki@cs.berkeley.edu>
  parent: SRIRAMK@charlie.usd.edu
  0 siblings, 0 replies; 3+ messages in thread

From: Paul M. Aoki @ 1994-12-04 21:07 UTC (permalink / raw)
  To: SRIRAMK@charlie.usd.edu; +Cc: legacy

SRIRAMK@charlie.usd.edu writes:
> My function given below doesn't work.
>      strcpy(folder_name, (char *) GetAttributeByName(t,"fldrname"));
> WARN:Nov 26 20:44:22:GetAttributeByName: a NULL isNull flag was passed

GetAttributeByName takes three arguments.  the third argument is a
Boolean by-reference argument that indicates whether the attribute is
NULL.

this was documented incorrectly in 4.1 but the documentation was
finally fixed in the last release..
--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1994-12-04 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1994-11-27 03:09 Error in using GetAttributeByName in a function SRIRAMK@charlie.usd.edu
1994-12-04 20:53 Error in using GetAttributeByName in a function SRIRAMK@charlie.usd.edu
1994-12-04 21:07 ` Paul M. Aoki <aoki@cs.berkeley.edu>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox