# Create new Xbase object using the file name passed in my $table = new XBase "$dbfFileName" or die XBase->errstr; # Get field names in the table my @fieldNames = $table->field_names; #### # Create a select statement to get this data from the table my $selectStatement = "SELECT "; $selectStatement .= join(', ',@fieldNames) ; # Add fields seperated by commas $selectStatement .= " FROM ./POIS.dbf"; # Add the dbf file print "$selectStatement\n\n\n" if $debugFlag; # Get handle by opening the .dbf file which has POI info in it my $dbh = DBI->connect("DBI:XBase:$directory") or die $DBI::errstr; my $sth = $dbh->prepare(" $selectStatement ") or die $DBI::errstr; $sth->execute() or die $sth->errstr(0); #### # Walk through results set one row at a time while ( my (@row) = $sth->fetchrow_array()) { my $LINK_ID = $row[0]; my $POI_ID = $row[1]; my $FAC_TYPE = $row[2]; my $POI_NAME = $row[3]; my $POI_LANGCD = $row[4]; my $POI_NMTYPE = $row[5]; my $POI_ST_NUM = $row[6]; ..... my $ACTION_COD = $row[26]; my $COMMENTS = $row[27]; my $POSITION_ = $row[28]; my $TEST_ID = $row[29]; #### my $localValues = "my \$"; $localValues .= join(', $',@fieldNames) ; # print "$localValues\n" if $debugFlag; #### while ( my ($localValues) = $sth->fetchrow_array()) #### my $LINK_ID, $POI_ID, $FAC_TYPE, .... $TEST_ID #### while ( my (my $LINK_ID, $POI_ID, $FAC_TYPE, .... $TEST_ID) = $sth->fetchrow_array()) #### my $prepStatement = <