agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Bruce Taneja. <aataneja@cs.mtu.edu>
To: postgres@postgres.Berkeley.EDU
Subject: define FUNCTION ..
Date: Sun, 26 Jun 1994 00:42:43 -0400 (EDT)
Message-ID: <9406260442.AA14339@cs.mtu.edu> (raw)


Howdy again !, 

.. haven't got any response to my previous query yet , and
here is another one .. :(

-------------
my  test function in circle.c : (compiled ok..)

bool  test(t, char1)
 TUPLE t;
 char *char1;
{

        BCIRCLE * bca = (BCIRCLE*) GetAttributeByName(t, "a");

  return (char1 == "1") ;  /*return +ve if i/p was 1 */
}
-------------
and the postgres reaction to it:

* 
                 define function test
  (language = "c", returntype = bool)
  arg is (tutorial, char16)
  as "/usr/local/postgres/bcircle.o" \g

Query sent to backend is "define function test   (language = "c", returntype = bool)   arg is (tutorial, char16)   as "/usr/local/postgres/bcircle.o" "
DEFINE
Go 
*           retrieve (tutorial.all)
where test(tutorial, "0") \g

Query sent to backend is "retrieve (tutorial.all) where test(tutorial, "0") "
NOTICE:Jun 26 00:33:32:type mismatch in invocation of function test
WARN:Jun 26 00:33:32:no such attribute or function test

---------------------------

I think postgres does not like the "0" string parameter.. 

Is there any way to pass strings in "quotes" to your
defined function ??  (like my "0" ) ??

----------------------------

thanks .. 
Bruce!

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



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: aataneja@cs.mtu.edu
  Subject: Re: define FUNCTION ..
  In-Reply-To: <9406260442.AA14339@cs.mtu.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