0
儘管對參數中存在的所有標量值都有正確的值,但由於$rc
值的原因,此代碼段保持失敗。我不確定$rc
值是如何在此計算的。Perl代碼中的錯誤
@args = ("$isql_exe", "-U$user", "-P$password", "-S$server",
"-D$database", "-i$tmp_sql_file", "-o$tmp_err_file");
print $log_file "Truncating stage tables\n";
$rc = 0xffff & system (@args); # <--- what this does?
if ($rc != 0) {
$rc &= 0x00ff;
print $log_file "Error Executing SQL command script $rc $?\n";
$rc = 1;
} ## end if
請推薦一些東西。
什麼是錯誤信息? – Borodin
在你不理解的行中,'$ rc'被設置爲'system'命令返回值的最低16位。如果出現錯誤,它將作爲錯誤代碼由外部命令返回,並且它不直接成爲該行的一個問題。 –
您確實有一個名爲'$ isql_exe'的變量,或者是變量'$ i'加上字符串'sql_exe'? – TLP