my $path = 'C:\TestSQL';
my @scripts = `dir /B /s $path`;
foreach my $psqlfile (@scripts) {
if ( $psqlfile =~ /^(.+\\p\_[^\\]+\.sql)\s*$/i ) {
`psql -q -h <Hostname> -p <Port> -d <Database> -U <Username> -f $psqlfile.sql -o outputfile`;
}
}
my @scripts = `dir /B /s $path`;
foreach my $psqlfile (@scripts) {
if ( $psqlfile =~ /^(.+\\p\_[^\\]+\.sql)\s*$/i ) {
`psql -q -h <Hostname> -p <Port> -d <Database> -U <Username> -f $psqlfile.sql -o outputfile`;
}
}
No comments :
Post a Comment