Help for this page

Select Code to Download


  1. or download this
    # query to get  Centers
    $cent_sth=$dbh->prepare("SELECT DISTINCT Center FROM People");
    ...
    while (@depts = $dept_sth->fetchrow_array()) {
        print "\t@depts[0]\n";
    }
    
  2. or download this
    my %orgs = ("Center", "cent_sth", "Div", "div_sth", "Dept", "dept_sth"
    +)
    while (($name, $this_sth)=each (%orgs)){
        $this_sth=$dbh->prepare("SELECT DISTINCT $name FROM People");
        $this_sth->execute() or die "Failed to retrieve list of $name from
    + database. $DBI::errstr";
    }