Обсуждение: Operator to compare numeric and double precision

Поиск
Список
Период
Сортировка

Operator to compare numeric and double precision

От
Terry Yapt
Дата:
Hello all,

It is a basic question (I hope it).

Are there any operator to compare numeric with double precision ?

It is something relative to Delphi/ODBC stuff.  I cannot cast neither numeric nor double precision operands.  I must to
getan operator to compare something like this: 
-*- numeric = double precision
-*-     1   = 1.00000  (and get TRUE)..

Numeric type is identified by Delphi with float type (independent of its ZERO precision), and here is the problem
becausein spite of I am passing -1- to the parameter, Delphi is converting it to 1.00000. 

Thanks in advance...


Re: Operator to compare numeric and double precision

От
Christoph Dalitz
Дата:
> Date: Sun, 27 Oct 2002 13:02:38 +0100
> From: Terry Yapt <pgsql@technovell.com>
>
> Are there any operator to compare numeric with double precision ?
>
Try the SQL-Function CAST (its part of the SQL2 standard), eg.

... WHERE doublefield = (CAST numericfield AS DOUBLE) ...

I don't know whether ODBC supports SQL-Functions directly; you will
probably need to use the "PASSTHROUGH" parameter.

Hope this helps,

Christoph Dalitz

Re: Operator to compare numeric and double precision

От
Terry Yapt
Дата:
Hi Christoph,

I cannot use CAST in this exact example.  I have _only_ be able to
change the operator in the whole expression...

I mean:

a = b  (give me the error, because a=numeric and b=double precision)

I need something like (for example):
a =!= b  (an _equal_ operator which support a numeric and double
precision operands)..  I am inventing this '=!=' operator type...

Thanks...

Christoph Dalitz wrote:
>
> > Date: Sun, 27 Oct 2002 13:02:38 +0100
> > From: Terry Yapt <pgsql@technovell.com>
> >
> > Are there any operator to compare numeric with double precision ?
> >
> Try the SQL-Function CAST (its part of the SQL2 standard), eg.
>
> ... WHERE doublefield = (CAST numericfield AS DOUBLE) ...
>
> I don't know whether ODBC supports SQL-Functions directly; you will
> probably need to use the "PASSTHROUGH" parameter.
>
> Hope this helps,
>
> Christoph Dalitz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)