But the output doesn't contain any column headers and only returns the first resultset as follows:#!/cluster/uapp/perl/bin/perl -w use KAP; use strict; use Date::Manip; use DBAccess; use EQ_Misc; use DBD::CSV; use MIME::Lite; use Net::SMTP; use Data::Dumper; my $_db_lv_conn_file = "MSLV.eq_script_user"; my $_read_dbi = undef; # Run stored proc my $sp = "longview..norges_integrity_check_tax_lot"; KAP::write_log("Preparing $sp"); $_read_dbi = KAP::opendbi($_db_lv_conn_file) || handle_error_and_e +xit ("Failed to get a connection to MSLV db server"); my $_read_sth = $_read_dbi->prepare($sp); if($DBI::err) { handle_error_and_exit("**ERROR preparing $sp: " . $DBI::errstr +); } KAP::write_log("Prepare done, executing $sp"); $_read_sth->execute(); if($DBI::err) { handle_error_and_exit( "**ERROR executing $sp: " . $DBI::errst +r); } KAP::write_log("Execute of $sp done"); my $_datafile = KAP::datafile(); my $numrecords = 0; my @data = undef; do{ while (my $row = $_read_sth->fetchrow_arrayref()) { print Dumper $row; } } while ($_read_sth->{syb_more_results});
But basically what I want is that whatever the stored procedure returns(all the 7 resultsets), just to dump that on the screen with all the header columns etc.nbsda1@vcstest3$ perl sudip.pl $VAR1 = [ '15140EQJP_55121', 'DD UN', '2018175', 'DU PONT (E.I.) DE NEMOURS', 'BO data mismatch', '275000.0', '98027EQJP_54981' ]; $VAR1 = [ '15140EQJP_55121', 'CMI UN', '2240202', 'CUMMINS INC', 'BO data mismatch', '100000.0', '98059EQJP_53421' ]; $VAR1 = [ '15140EQJP_55121', 'DOW UN', '2278719', 'DOW CHEMICAL', 'BO data mismatch', '175000.0', '98027EQJP_54981' ]; nbsda1@vcstest3$
In reply to Re^6: Writing Multiple Recordsets into a CSV file
by sudip_dg77
in thread Writing Multiple Recordsets into a CSV file
by sudip_dg77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |