Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Select quuery result sets

by Anonymous Monk
on Aug 23, 2010 at 12:08 UTC ( #856686=note: print w/replies, xml ) Need Help??

in reply to Select quuery result sets

Hello Monks,

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

$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); }

Need your valuable inputs to resolve this

Replies are listed 'Best First'.
Re^2: Select quuery result sets
by pajout (Curate) on Aug 24, 2010 at 12:06 UTC
    I am not sure, what output data structure you require. Please, can you specify it?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://856686]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2018-06-23 18:39 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.