0
連接時重新調整錯誤的價值觀我有folllowing Perl代碼:我的Perl DBI->連接失敗
my $dbo_prd = DBI->connect(
"dbi:Oracle:host=$db_srv_prd;port=1521;sid=$db_sid_prd",
$db_user_prd,
$db_pass_prd
) || warn &senderror("TREE_STRUCTURE.Could not connect to $db_srv_prd: $DBI::errstr\n");
print "\n\nconnection:" . $dbo_prd . "\n";
if ($dbo_prd != 1){
print "in prod prepare\n\n";
my $query1_prd = $dbo_prd->prepare(
"INSERT INTO CMSV2.CMS_INBOX VALUES (
'vmsdk', (SELECT SYSDATE from DUAL), 'NODE_TREE_UPDATE',?,?,?,?,NULL,NULL
)"
) || warn &senderror("TREE_STRUCTURE.Could not prepare to $db_srv_prd: $DBI::errstr\n");
}
說我遇到的問題是,我認爲,如果連接不工作它會將連接$ dbo_prd設置爲undef,但將它設置爲1?這不是文檔在任何地方的狀態。
連接在失敗時打印爲「1」,如果連接成功,則連接將被打印輸出。