Re: [SQL] locked my keys in the car

Поиск
Список
Период
Сортировка
От Thomas Good
Тема Re: [SQL] locked my keys in the car
Дата
Msg-id Pine.SV4.3.91.980803163848.17207A-100000@q8.nrnet.org
обсуждение исходный текст
Список pgsql-sql
> From: John Edstrom <edstrom@Poopsie.hmsc.orst.edu>
> To: pgsql-sql@postgreSQL.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@q8.nrnet.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


В списке pgsql-sql по дате отправления:

Предыдущее
От: lynch@lscorp.com (Richard Lynch)
Дата:
Сообщение: Re: [SQL] locked my keys in the car
Следующее
От: Eric McKeown
Дата:
Сообщение: inheritance question