new version of select_csv_file
This commit is contained in:
parent
ea29f3e0d4
commit
72353f4d32
1 changed files with 5 additions and 9 deletions
|
@ -1050,16 +1050,12 @@ sub select_csv_file {
|
||||||
my $tfile= shift;
|
my $tfile= shift;
|
||||||
my $req = shift;
|
my $req = shift;
|
||||||
debugprint "PERFORM: $req CSV into $tfile";
|
debugprint "PERFORM: $req CSV into $tfile";
|
||||||
`$mysqlcmd $mysqllogin -Bse "\\w$req" 2>>/dev/null| sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > $tfile`;
|
my @result =select_array($req);
|
||||||
if ( $? != 0 ) {
|
open( my $fh, '>', $tfile ) or die "Could not open file '$tfile' $!";
|
||||||
badprint "Failed to execute: $req";
|
for my $l (@result) {
|
||||||
badprint "FAIL Execute SQL / return code: $?";
|
print $fh $l;
|
||||||
debugprint "CMD : $mysqlcmd";
|
|
||||||
debugprint "OPTIONS: $mysqllogin";
|
|
||||||
debugprint `$mysqlcmd $mysqllogin -Bse "$req" 2>&1`;
|
|
||||||
|
|
||||||
#exit $?;
|
|
||||||
}
|
}
|
||||||
|
close $fh;
|
||||||
}
|
}
|
||||||
sub human_size {
|
sub human_size {
|
||||||
my ( $size, $n ) = ( shift, 0 );
|
my ( $size, $n ) = ( shift, 0 );
|
||||||
|
|
Loading…
Reference in a new issue