Re: SQL::Abstract 1.18
[prev]
[thread]
[next]
[Date index for 2005/03/04]
At 20:42 3/3/2005, you wrote:
>>>>>> "Nathan" == Nathan Wiger <nate@xxx.xxx> writes:
>
>Nathan> Hey all-
>Nathan> So thought you'd like to know I just finished SQL::Abstract 1.18,
>Nathan> which contains a fix for this problem in 1.17:
>
>Nathan> name => { '!=', 'Bob', '!=', 'Jim' } # can't do that
>
>Sure you can. I had to do that. Did it this way:
>
> name => { '!=', 'Bob', ' !=', 'Jim' }
>
>Note the space. :)
But then that falls apart on even farther out edge cases:
DB<2> use SQL::Abstract;
DB<3> $sql = SQL::Abstract->new();
DB<4> x ($stmt,@bind) = $sql->where({ abc => {'!=','Bob',' !=','Jim', ' !=', 'Sam'} } );
0 ' WHERE ( abc != ? AND abc != ? AND abc != ? )'
1 'Sam'
2 'Jim'
3 'Bob'
DB<11> x ($stmt,@bind) = $sql->where({ abc => {'!=',undef,' !=','Jim', ' !=', 'Sam'} } );
0 ' WHERE ( abc != ? AND abc != ? AND abc IS NOT NULL )'
1 'Sam'
2 'Jim'
DB<12> x ($stmt,@bind) = $sql->where({ abc => {' !=',undef,' !=','Jim', '!=', 'Sam'} } );
0 ' WHERE ( abc IS NULL AND abc != ? AND abc != ? )'
1 'Jim'
2 'Sam'
While I sure do wish I'd seen this gem 3 days ago, and do appreciate it, I'd prefer the more specifically general solution proposed in 1.18