Adriano dos Santos Fernandes wrote 19.08.2022 12:05:
So it would be something like COALESCE.
I think that is the wrong approach for parameters. When deriving a type
for COALESCE, it makes sense to infer the type to the widest possible
type (VARCHAR) to allow all possible stored values to be represented,
but with parameters, it is IMHO better to use the most specific type, as
that will yield useful information to the user through the metadata, and
probably result in the best diagnostic information when specifying
invalid values.

You prefer large over smaller VARCHARs, prefer TIMESTAMP over TIME -
widest types

But prefer TIMESTAMP and NUMBERS over VARCHAR - most specific

I see no logic in your approach.

  It is on contrary.
With COALESCE a datatype is chosen which every given datatype can be converted into. With parameters a datatype must be chosen which can be converted into any of given types. (Almost) any type can be converted to VARCHAR so it is a good choice for COALESCE. VARCHAR is hardly guaranteed to be converted into any datatype so it is a bad choice for parameters' common type.

--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to