in reply to Doubts about Class:DBI

You already about lazy population, which explains why it only fetches the primary key until you ask for more, so unless you have more questions about that your actual question here is why the ShipCity() method call fails to return anything. Can you show us the database table you're using? Are you positive it has data for ShipCity? Can you try printing the other columns to see if they work?

UPDATE: davidrw has it right: just an interpolation problem.

Replies are listed 'Best First'.
Re^2: Doubts about Class:DBI
by shonorio (Hermit) on Aug 24, 2005 at 14:51 UTC
    I'm using the Northwind database, available on all SQL Server, and I've tried to print all columns whith the same output, "primarykey->columnname".
    # Output code 10248->ShipCity 10251->ShipCity 10265->ShipCity 10274->ShipCity 10295->ShipCity 10297->ShipCity 10311->ShipCity 10331->ShipCity 10334->ShipCity 10340->ShipCity 10350->ShipCity 10358->ShipCity 10360->ShipCity 10362->ShipCity 10371->ShipCity 10408->ShipCity 10413->ShipCity 10425->ShipCity 10436->ShipCity 10449->ShipCity 10450->ShipCity 10454->ShipCity 10459->ShipCity 10470->ShipCity 10478->ShipCity 10480->ShipCity 10493->ShipCity 10500->ShipCity 10511->ShipCity 10525->ShipCity 10546->ShipCity 10559->ShipCity 10566->ShipCity 10584->ShipCity 10609->ShipCity 10610->ShipCity 10628->ShipCity 10631->ShipCity 10634->ShipCity 10663->ShipCity 10671->ShipCity 10679->ShipCity 10683->ShipCity 10715->ShipCity 10730->ShipCity 10732->ShipCity 10737->ShipCity 10738->ShipCity 10739->ShipCity 10755->ShipCity 10763->ShipCity 10787->ShipCity 10789->ShipCity 10806->ShipCity 10814->ShipCity 10826->ShipCity 10827->ShipCity 10832->ShipCity 10843->ShipCity 10850->ShipCity 10858->ShipCity 10860->ShipCity 10871->ShipCity 10876->ShipCity 10890->ShipCity 10907->ShipCity 10923->ShipCity 10927->ShipCity 10932->ShipCity 10940->ShipCity 10964->ShipCity 10971->ShipCity 10972->ShipCity 10973->ShipCity 11043->ShipCity 11051->ShipCity 11076->ShipCity
    Solli Moreira Honorio
    Sao Paulo - Brazil
      oh. it's just an interpolation problem. change your print statement to one of these:
      print $Order->ShipCity . "\n"; printf "%s\n", $Order->ShipCity;
        Thanks for your help.
        Solli Moreira Honorio
        Sao Paulo - Brazil