Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    16

    Unanswered: problems querying column info

    I am trying to print out column names and it seems i am doing something wrong. Any help??

    use DBI;
    # use DBIx:BSchema::Column;

    #open connection to Access database
    $dbh = DBI->connect('dbi:ODBC:driver=microsoft access driver
    (*.mdb);dbq=C:\Temp\database.mdb');


    # retrieving field names
    $cursor = $dbh->prepare("SELECT * FROM combined_structures where 1=0");
    $cursor->execute;
    my($fieldNames, $i);
    $fieldNames = $cursor->{"NAME"};
    print "Field Names = ";
    for($i=0; $i < @$fieldNames; $i++)
    {
    print "$fieldNames->[$i], ";
    }
    print "\n";

  2. #2
    Join Date
    Sep 2004
    Posts
    16
    Basically, i have a bunch of databases containing a bunch of tables and i need to write a report for each database showing whether the tables contain 0 or null values, with a simple Y or N

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Ahhh! The sample code helps a great deal, but you really need to post this message to the Perl and the DBI forum.

    -PatP

  4. #4
    Join Date
    Sep 2004
    Posts
    16
    yeah, sorry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •