I've recently started using DBD::CSV and am having some really good
results with it. I chose it because I wanted to keep my data in
editable
files, I wanted to be able to do simple change control management (ie,
using RCS/CVS) and yet I needed to do simple relational queries over
them ... DBD::CSV is simply the best thing for all of these things,
especially whilst I'm tinkering with my data model ... so thanks for
the
module!

I'm having a few niggling things happen though. One of these which is
annoying, but not critical is an warning I often get with a query which
has a table join or two: 'Execution ERROR: Can't find shared columns!'

It doesn't seem to affect the results of the query, but I don't know
exactly why I'm seeing it, since there are shared columns as far as I
can see - they're what I'm basing the join on, afterall ... 

Here's the relevant bits of the data model:

  people: PersonID LastName FirstName MiddleName
  positions:      PositionID PersonID DeptID RoleID
  tenants:        PersonID MachineID RoomID
  phones: PhoneNo RoomID Description
  rooms:  RoomID BuildingID RoomNo Description
  buildings:      BuildingID CampusCode BuildingNo Description

.... and the query that's giving me trouble at the moment (it's stage
one
on a query to generate a departmental phone book):

  SELECT  people.PersonID, positions.RoleID, positions.DeptID,
          phones.PhoneNo, rooms.RoomNo, rooms.BuildingID,
          buildings.BuildingNo, buildings.CampusCode
  FROM    people, positions, tenants, phones, rooms, buildings
  WHERE   positions.PersonID = people.PersonID
          AND tenants.PersonID = people.PersonID
          AND phones.RoomID = tenants.RoomID
          AND rooms.RoomID = tenants.RoomID
          AND buildings.BuildingID = rooms.BuildingID

When I execute the query I get 4 'Can't find shared columns!' warnings, 
but the correct results are returned ... 

I don't seem to be able to turn it off either. From the manual page and
from looking at source code for SQL::Statement I would have thought
that

  $sth->{'PrintError'} = undef;

or

  $dbh->{'PrintError'} = undef;

would turn off the error message and stop the warning, but it doesn't.
(yes, the sample query in the manual page was the one I based my code
on,
it just got more tables and a more complex query ... :)

The relevant portion of SQL::Statement that is causing this appears to
be
within join_2_tables(), line 514, approx:

    %is_shared = map {$_=>1} @shared_cols;
    $self->do_err("Can't find shared columns!") unless @shared_cols;
    for my $c(@shared_cols) {
      if ( !$iscolA{$c} and !$iscolB{$c} ) {
          $self->do_err("Can't find shared columns!");
      }
    }

do_err() has the following lines (which is what I thought would control
the output):

    $self->{"errstr"} = $err;
    warn $err if $self->{"PrintError"};
    # print $err if $self->{"PrintError"};
    die "\n" if $self->{"RaiseError"};

.... can anyone help me out here? 

thanks



-- 
Malcolm Herbert                                This brain intentionally
[EMAIL PROTECTED]                                                left blank

Reply via email to