sub mwsexecutesql { local $mwssql = $_[0]; local $spl = $_[1]; local $field; local $data; local @ary; $data = ""; $mwssth = $mwsdbh->prepare(qq{$mwssql}) || &mwserror("DB Error: \"" . $mwsdbh->errstr . "\" while preparing SQL statement \"$mwssql\"",""); $mwssth->execute() || &mwserror("DB Error: " . $mwsdbh->errstr . "\" while preparing SQL statement \"$mwssql\"",""); while (@ary = $mwssth->fetchrow_array()) { foreach $field (@ary) { chomp($field); $data = "$data$field$spl"; } $data = "$data\n"; } $mwssth->finish(); return substr($data,0,length($data)-1); }