Subject: Postquel function question..

From: "Manoj K. Jain" <[email-masked]>
Date: Fri, 4 Dec 1992 12:01:13 -0500 (EST)

Hello,
	What is the problem with this? Why am I getting a syntax
error? Thanks!
-- Manoj
===========================================================================
* define function sal_lookup
        (language = "postquel", returntype = int4)
        arg is (text)
        as "retrieve (EMP.salary) where EMP.name = $1" \g

Query sent to backend is "define function sal_lookup    (language = "postquel", returntype = int4)      arg is (text)   as "retrieve (EMP.salary) where EMP.name = $1" "
DEFINE
Go 

* retrieve (EMP.name)
        where EMP.salary = sal_lookup("Joe") \g

Query sent to backend is "retrieve (EMP.name)   where EMP.salary = sal_lookup("Joe") "
NOTICE:Dec  4 11:50:27:type mismatch in invocation of function sal_lookup
WARN:Dec  4 11:50:27:no such attribute or function sal_lookup

Go
* retrieve (EMP.all) \g

Query sent to backend is "retrieve (EMP.all) "
---------------------------------------------------------
| name        | salary      | age         | dept        |
---------------------------------------------------------
| Sam         | 1200        | 29          | toy         |
---------------------------------------------------------
| Joe         | 1200        | 40          | shoe        |
---------------------------------------------------------

Go
*

---

From: <[email-masked]>
Date: Fri, 04 Dec 92 12:36:24 PST

> WARN:Dec  4 11:50:27:no such attribute or function sal_lookup

heh heh heh.  no default typecasting.  you need to do

> * retrieve (EMP.name)
>         where EMP.salary = sal_lookup("Joe"::text) \g

this brain-damage may go away in 4.1.
					mike olson
					project sequoia 2000
					uc berkeley
					[email-masked]