Subject | Re: [firebird-support] How To raise system exception, or set gds/sql code to custom value |
---|---|
Author | Adomas Urbanavicius |
Post date | 2005-09-27T15:35:12Z |
Thanks,
This will do for this case; Anyway there are plenty of system exceptions
:) : just curious are there posibility to raise them manually in PL/SQL.
Adomas
Ivan Prenosil wrote:
This will do for this case; Anyway there are plenty of system exceptions
:) : just curious are there posibility to raise them manually in PL/SQL.
Adomas
Ivan Prenosil wrote:
>> If there is table with PK, so if we are trying to enter dublicate
>>value, we get exception. GDSCODE unique_key_violation
>>
>>And application receives gdscode 335544665 (or sql code -803).
>>
>>I need to fire same exception manually in custom trigger, that application faced same behavior as inserting dublicate
>>into PK.
>>Something like: App does custom job:SP,several inserts, whatever : receives exeption unique_key_violation, but in DB
>>that exception is generated by custom trigger,not by PK contraint.
>>
>>
>
>Just invoke the "real" exception. I.e. add this to your metadata
>
> CREATE TABLE T(F INTEGER UNIQUE);
> INSERT INTO T(F) VALUES(0);
>
>and whenever you want to raise the exception do
>
> INSERT INTO T(F) VALUES(0);
>
>Ivan
>
>
>
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://firebird.sourceforge.net and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>