in reply to Oracle Placeholder Problem in my Perl Script

What could be the problem?
What are the symptoms? Does your code behave is some way other than you intended? If so what way?
my $query_records2 = $conn->prepare($mainquery) or die("Error on prepa +ring the sql statement2 \n"); $query_records2->execute() or die("Error on getting the data from QUER +YDETAIL \n");
Consider including the actual error ($DBI::errstr or the errstr() method) in your error messages. If you code is failing it can make much easy to figure out why.