When executing a command, iiuc, the driver implicitly creates an anonymous block for the execution. If the command itself is bad, the block will not compile and call itself will fail putting an error in the driver's error variable.
If the code CALLs a stored PROCEDURE, and the error happens within it, as long as you are not trapping errors in the SP itself, the SP will fail and will pass the EXCEPTION to the anonymous block where it is (trapped by the driver and) put into the driver's error variable.
If you trap EXCEPTIONs in the SP, your own code will do what you told it to, so unless you re-RAISE the EXCEPTION (making the trapping of it pretty useless to begin with) you won't get it.
A simple statement like TRUNCATE is best implemented with host variables. It is more secure (no chance of SQL injection), and once put right, can not have syntactical errors.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.