Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA02140; Fri, 4 Dec 92 12:35:11 -0800
Message-Id: <9212042035.AA02140@postgres.Berkeley.EDU>
From: <mao@postgres.berkeley.edu>
Subject: Re: Postquel function question..
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Fri, 04 Dec 92 12:01:13 EST.
             <9212041700.AA00682@postgres.Berkeley.EDU> 
Date: Fri, 04 Dec 92 12:36:24 PST

In message <9212041700.AA00682@postgres.Berkeley.EDU> you write:

> 	What is the problem with this? Why am I getting a syntax
> error? Thanks!

> * define function sal_lookup
>         (language = "postquel", returntype = int4)
>         arg is (text)
>         as "retrieve (EMP.salary) where EMP.name = $1" \g
> 
> * retrieve (EMP.name)
>         where EMP.salary = sal_lookup("Joe") \g
> 
> 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

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
					mao@cs.berkeley.edu
