ABC JKL HGJ KJI GHJ LKJ #### sub Emp_Name { my $sth = $dbh->prepare(<<"SQL") or die "Prepare failed: " . $dbh->errstr(); SELECT DISTINCT EMP_NAME FROM EMPLOYEE WHERE EMP_ID = ? SQL $sth->execute () or die "Cannot execute: " . $sth->errstr(); while ( %Result = $sth->fetchrow() ) { print Dumper(%Result); } $sth->finish; }# end