[dev] [cvs] commit: turba/lib Driver.php api.php turba/lib/Driver sql.php
Michael Rubinsky
mike at theupstairsroom.com
Mon Oct 29 16:53:57 UTC 2007
Quoting Jan Schneider <jan at horde.org>:
> Zitat von Michael Rubinsky <mike at theupstairsroom.com>:
>
>> Quoting Jan Schneider <jan at horde.org>:
>>
>>> jan 2007-10-29 11:21:28 EDT
>>>
>>> Modified files:
>>> lib Driver.php api.php
>>> lib/Driver sql.php
>>> Log:
>>> Catch errors.
>>> Fix query generation.
>>> Use ANSI SQL (works fine with DATE columns in MySQL too btw).
>>> Simplify code.
>>
>>
>> I was under the impression that not all RDBMS actually implemented the
>> ANSI version of the substring() command. In particular (at least some
>> versions of) MS SQL implement it in the (string, from, to) kind of way.
>
> That sucks. Does that mean that not all RDMBS implement the ANSI
> version, but all implement a non-standard version that works
> everywhere the same? I wonder what standards are for.
Yea, what we need are better standards for implementing standards :)
Anyway, the substr() version was the only one that I found that works
the same across the different servers I checked the manual for. MS
SQL and Oracle (at least according to the text I have here at home)
both do not implenet the substring() function. I think MS SQL aliases
substring() to substr(), but it still only accepts the (string, from,
to) parameters. MySQL I believe accepts both versions. PostgreSQL
accepts the ANSI form, but translates it the substr() function with
the three parameters...and DB2 takes the three parameters as
well...but I don't remember if it also take the ANSI version.
> You can always add more function arguments when necessary. There is no
> advantage in passing a hash, it's a private function anyway.
Ok.
Thanks,
mike
--
The Horde Project (www.horde.org)
mrubinsk at horde.org
"Time just hates me. That's why it made me an adult." - Josh Joplin
More information about the dev
mailing list