Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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


Comment on Re: Select quuery result sets
Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://856686]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-12-26 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (164 votes), past polls