#! perl -w
#
# Perl program which dumps the atom table from the compound DB

use strict;
use DBI;

my $dsn = "DBI:mysql:compound:localhost";	# data source
my $user_name = "chem";						# user name
my $password = "chem";						# password

# connect to database
my $dbh = DBI->connect( $dsn, $user_name, $password,
						{ RaiseError => 1, PrintError => 0 } );

# issue query
my $sth = $dbh->prepare("SELECT * FROM atom ORDER BY atom_id");

$sth->execute();

# read results of query, then clean up
while( my @ary = $sth->fetchrow_array() )
{
	print join("\t", @ary), "\n";
}
$sth->finish();
$dbh->disconnect();
exit(0);
