in reply to Re^2: How to Fetch records from Oracle DB view
in thread How to Fetch records from Oracle DB view

Another issue I missed - you've used fetchall_arrayref() (see DBI) and then attempted to access the results as a hash. Part of the issue is of course that I can't run your script to test it since I don't have access to your database so I can't debug. I can only guess that your code through the execute is functioning correctly. I do note that you are mixing hash and array access concepts in accessing the results. As per the documentation,

The fetchall_arrayref method can be used to fetch all the data to be returned from a prepared and executed statement handle. It returns a reference to an array that contains one reference per row.

So based on what I'm reading, you first need to modify your SQL to only select the column you are looking for (ROW_DATA presumably) and then access the results like an array reference:

foreach my $record (@$row1) { $report.= "$row1->[0]\n"; }

Alternatively, you could change the 0 in the above to reflect the appropriate column for what you are trying to do. Please read perlreftut, DBI and a review of Perl variable types might not be a bad idea. As well, please read the error messages and consider what they say.