[Info-ingres] When is an empty string an integer?

Martin Bowes martin.bowes at ndph.ox.ac.uk
Wed May 11 14:00:45 UTC 2016


I'd be scared of fixing it. Perhaps if it had a configurable option like empty_string_as_zero: true|false

Either way I'd suggest its behaviour be documented in the SQL guide under the Numeric Assignments section in Chapter 4.

Shall I raise as an enhancement request?

Marty

-----Original Message-----
From: Karl Schendel [mailto:schendel at kbcomputer.com] 
Sent: 11 May 2016 14:54
To: Ingres and related product discussion forum
Subject: Re: [Info-ingres] When is an empty string an integer?

On May 11, 2016, at 9:44 AM, Roy Hann <specially at processed.almost.meat> wrote:
> 
> Martin Bowes wrote:
> 
>> FYI. Geraint Jones has informed me that:
>> Various DBMS's disagree on how to handle cast('' as integer).
>> 
>> Ingres : 0.
>> Oracle : NULL.
>> Postgres : Error.
> 
> Oracle, wrong as usual--but not as wrong as Ingres on this occasion!
> 
> Postgres gets my nod on this one.
> 
> Roy
> 
> PS: I wonder if Ingres' alignment with MySQL's foolishness is just 
> accidental? I do hope so.

Yes, I'm sure it is.  The relevant CVal routine in the CL does nothing if it sees no digits, and returns OK.  I'm sure it's been that way since forever.

Karl

_______________________________________________
Info-ingres mailing list
Info-ingres at lists.planetingres.org
http://lists.planetingres.org/mailman/listinfo/info-ingres



More information about the Info-ingres mailing list