Issue Details (XML | Word | Printable)

Key: CORE-832
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Ain Valtin
Votes: 6
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Add support for parametrised exceptions

Created: 28/Jun/06 01:52 AM   Updated: 20/Aug/16 05:02 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 3.0 Alpha 1

Issue Links:
Duplicate
 
Relate

QA Status: Covered by another test(s)
Test Details: See tests for core4160 & core-4811.


 Description  « Hide
Allow to create exception messages where some part(s) are replaced when exception is raised. Something like:

CREATE EXCEPTION EXP_WrongDate 'Date must be between %1 and %2 (%3)';

CREATE TRIGGER ...
ACTIVE BEFORE INSERT POSITION 10
DECLARE DRngB DATE;
DECLARE DRngE DATE;
AS BEGIN
  ...find value for DRngB and DRngE
  if(NOT((DRngB <= NEW.ItmDate)AND(DRngE >= NEW.ItmDate)))THEN
     EXCEPTION EXP_WrongDate(DRngB, DRngE, NEW.ItmDate);
END

Exception parameters should be automatically casted to VARCHAR of appropriate length.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
arni added a comment - 26/Oct/09 09:38 PM
SDF FORMAT would be solution in this case and be useful in general.
For what need syntax complicating?

Adriano dos Santos Fernandes added a comment - 14/Jan/10 02:47 PM
Documented in doc/sql.extensions/README.exception_handling.