my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->func( 'DBTable', 'Pipe', "db.txt", $col_nm, 'ad_catalog' ) ; my $sth = $dbh->prepare( $sql ) ; $sth->execute() ; where $sql = select col1 , col2 , col3 , ... , colN from Depcorr where col1 = '12345' and $col_nm { col_names => 'col1,col2,col3,...colN' } ;