APM: DBI "bug"

David Bluestein II dbii at interaction.net
Sun Sep 14 21:37:34 CDT 2003


Wayne-

How about this to get your ref:

 SELECT b.ID as bID, c.ID as cID, c.ID as cID2
      from Bugs as b, Clients as c, Projects as p
...

Does that give you what you need? I use that when doing hashrefs with
similarly named fields in different tables. And you can decide which one to
not rename and leave it under ID key.

David

>I've since found a reference in the man page that specifies that this
>works as I describe and I just have to live with it.   :(
>
>On Sun, Sep 14, 2003 at 08:16:37PM -0500, Wayne Walker wrote:
>> Given the following SQL:
>>
>> SELECT b.ID, c.ID, c.ID
>>       from Bugs as b, Clients as c, Projects as p
>>       WHERE b.project = p.ID AND p.client = c.ID;
>>
>> fetchall_arrayref() (or anything that uses fetchrow_arrayref()) works
>> fine, but I dislike using array references, and prefer hashrefs.
>>
>> fetchrow_hashref returns only one result per row because all 3 fields
>> have different tables but the same column name.
>>
>> Is there a switch in DBI to use table.column instead of just column when
>> building hashrefs?  I couldn't find one....
>>
>>
>> --
>>
>> Wayne Walker
>>
>> www.broadq.com :)  Bringing digital video and audio to the living room
>> _______________________________________________
>> Austin mailing list
>> Austin at mail.pm.org
>> http://mail.pm.org/mailman/listinfo/austin
>
>--
>
>Wayne Walker
>
>www.broadq.com :)  Bringing digital video and audio to the living room
>_______________________________________________
>Austin mailing list
>Austin at mail.pm.org
>http://mail.pm.org/mailman/listinfo/austin

----------
David H. Bluestein II                         President & Lead Developer
dbii at interaction.net                         ii, inc.

http://www.interaction.net
-        Specializing in Designing Interactive Websites        -
-              and Searchable Internet Databases                   -








More information about the Austin mailing list