Re: [SQL] locked my keys in the car

From: Thomas Good <tomg(at)q8(dot)nrnet(dot)org>
To: John Edstrom <edstrom(at)Poopsie(dot)hmsc(dot)orst(dot)edu>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] locked my keys in the car
Date: 1998-08-03 20:41:26
Message-ID: Pine.SV4.3.91.980803163848.17207A-100000@q8.nrnet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> From: John Edstrom <edstrom(at)Poopsie(dot)hmsc(dot)orst(dot)edu>
> To: pgsql-sql(at)postgreSQL(dot)org

> How about
> CREATE FUNCTION F(int,char) returns int4 as
> 'SELECT max(tr_date) FROM crtd1
> WHERE $1=tr_id
> AND $2=tr_unit
> AND (tr_type = \'A\' OR
> tr_type = \'I\');'
> language 'sql';
>
> SELECT distinct tr_id,F(tr_id) from crtd1;

Good idea but...Arrrgh!

This is what I get back:

ERROR: There is no operator '=' for types 'int4' and 'bpchar'
You will either have to retype this query using an explicit cast,
or you will have to define the operator using CREATE OPERATOR

(thanks- I will keep fiddling...)
Tom

---------- Sisters of Charity Medical Center ----------
Department of Psychiatry
----
Thomas Good <tomg(at)q8(dot)nrnet(dot)org>
Coordinator, North Richmond C.M.H.C. Information Systems
75 Vanderbilt Ave, Quarters 8 Phone: 718-354-5528
Staten Island, NY 10304 Fax: 718-354-5056

Browse pgsql-sql by date

  From Date Subject
Next Message Eric McKeown 1998-08-03 22:33:46 inheritance question
Previous Message Richard Lynch 1998-08-03 20:11:39 Re: [SQL] locked my keys in the car