[Info-ingres] When is an empty string an integer?
Ian Kirkham
Ian.Kirkham at actian.com
Wed May 11 12:51:15 UTC 2016
Hi Marty,
Historically Ingres has always treated a string of just zero or more space characters as numeric 0 on conversion to integers.
MS excel does the same so it must be an industry standard - :)
Not something we could easily correct now.
Regards,
Ian
From: info-ingres-bounces at lists.planetingres.org [mailto:info-ingres-bounces at lists.planetingres.org] On Behalf Of Martin Bowes
Sent: 11 May 2016 13:42
To: info-ingres at lists.planetingres.org
Subject: [Info-ingres] When is an empty string an integer?
Hi All,
This is probably documented behaviour but I'm having a hard time finding it. So if someone could point me at the document I'd be happy.
What is the expected result of: select integer(varchar('', 1))
The answer is zero.
I must concede I can sort of see this as being necessary, but I'm curious as to why we just didn't get the standard error:
E_US100F String cannot be converted to numeric due to incorrect syntax.
Martin Bowes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20160511/7b7102f7/attachment.html>
More information about the Info-ingres
mailing list