#!/usr/pkg/bin/perl use lib qw(/arpa/ag/e/edgock/pllib/lib /arpa/ag/e/edgock/pllib/lib/site_perl); use strict; use DBI; my $haveFileSpec = eval { require File::Spec }; my $table_dir = File::Spec->catdir(File::Spec->curdir()); my $dbh = DBI->connect("DBI:CSV:f_dir=$table_dir", undef, undef, { 'RaiseError' => 1 }); my($sth); print "$table_dir"; $sth = $dbh->prepare("SELECT id FROM images"); $sth->execute(); # my($id,$imgord,$loc,$cat,$shtdesc,$lngdesc,$imgdate,$ctry); my($id); # $sth->bind_columns (undef,\$id,\$imgord,\$loc,\$cat,\$shtdesc,\$lngdesc,\$imgdate,\$ctry ); $sth->bind_columns (undef,\$id ); while ( $sth->fetch() ) { print "in loop\n"; print "$id \n"; } $sth->finish( ); $dbh->disconnect( ); exit;