in reply to Select query result sets
Thank you for the reply. The reason for not using fetchrow->arrayref is we require the column names as well We need to pass the entire resultset (Column names & column values) to a hash which prints it to the file. The extract from the script is given below
<p> Pls let me know how do I get the column names & values & pass to a has +h </p> $stmt = $dbh->prepare("$sql17"); $stmt->execute(); if($DBI::errstr) { warn "Execution of SQL failed: $DBI::errstr\n"; $dbh->rollback; closeOracleConnection($dbh); } else @rowData = $stmt->fetchrow_array(); $rowcnt = $#rowData; for ($i = 0; $i < $rowcnt; $i++) { @rs = $stmt->fetchrow_hashref(); push(@retArray,@rs); } $stmt->finish; if ($#retArray == -1) { print (stdout "\nCould not generate values\n"); exit (-1); }
|
|---|