Ron Reidy wrote:

>>$dbh->selectall_hashref(
>>    'select 5 as a, 6 as b union select 5 as a, 7 as b',
>>    'a'
>>);

>I do not think this should raise either an error nor a 
>warning.  In Sybase, what does the SQL statement return when 
>run in the SQL tool (iSQL?)?  Does it return 1 row, or both 
>rows?

I should have made clear that this is a query returning two rows:

    a        b
    5        6
    5        7

The current DBI behaviour is to throw away one of those rows, but it's
not documented which.

Rather than silently throwing away the row, it might be better to flag
up that the programmer has tried to use 'a' as a unique key, but it
turned out not to be unique.  That said, there may be cases where you
prefer for DBI to silently discard all but one row with a given value
of 'a'.

-- 
Ed Avis <[EMAIL PROTECTED]>

Reply via email to