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.


In reply to want to skip displaying of "DBD::Oracle::st execute failed:" error messages showing full query by sumalatha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.