sumalatha has asked for the wisdom of the Perl Monks concerning the following question:
In my web application want to skip displaying of error messages showing full query on screen to endusers.
example: ## save the variables to procure.RECPO2 using INSERT
$insert = "INSERT INTO procure.RECPO2 (po_number, requesto +r, req_num, send_to, vend_name, buyer_name) VALUES ('" . $sPO . "', '" . $vReqName . "', '" . $vSource . "', '" . $vSendTo . "', '" . $vVenNm . "', '" . $vBuyer . "')"; ## if requisition # is zero and requester blank - don't write record if (length($vSource) gt 1 && length($vReqName) gt 1) { $st6 = $dbh->prepare_cached($insert) or die "Couldn't prepare insert: " . $dbh->errstr; $st6->execute() or die "Couldn't execute insert: " . $st6->errstr; }
Result:
DBD::Oracle::st execute failed: ORA-00001: unique constraint (PROCURE. +PCR_RECPO2 _PK) violated (DBD ERROR: OCIStmtExecute) [for Statement "INSERT INTO +procure.RE CPO2 (po_number, requestor, req_num, send_to, vend_name, buy +er_name) V ALUES (' 1625162', 'ADRIAN SAMPS +ON', '9371 46', 'asampson@ochsner.org', 'NEOTECH PRODUCTS INC', 'LAURA SPURGEON') +"] at reqN ote_sh line 148. Couldn't execute insert: ORA-00001: unique constraint (PROCURE.PCR_REC +PO2_PK) vi olated (DBD ERROR: OCIStmtExecute) at reqNote_sh line 148.
Here in my application don't want to display the complete query to end users, instead of that want to show common error message.
Please let me know how can i do it. Thanks in advance.
|
|---|