Gleb Paharenko wrote:
> Hello.
>
> There was a question about exceptions recently. The answer might be
> helpful:
> http://lists.mysql.com/mysql/188048
>
>
>
> Leigh <ktulu@stripped> wrote:
>
>>Hi All,
>>
>>I'm currently working on porting a database form Informix 9.2 to MySQL 5
>>in order to determine the suitability of MySQL for our application. At
>>the moment, I'm stuck with one of our stored procs that contains the
>>following lines:
>>
>>-- If duplicates are detected, raise an error
>>IF count > 1 THEN
>> RAISE EXCEPTION -746, 0, 'Duplicate mapping: code "' || p_code ||
>>'", cust "' || p_cust_code || '"';
>>END IF;
>>
>>Under Informix, this IF statement raises a user defined JDBC Exception
>>(the code "-746" is for user defined errors). Is there any way of doing
>>a similar thing in MySQL?
>>
>>If you need any more information, I'm happy to provide it. Thanks in
>>advance!
>>Regards,
>>Leigh
>>
>
Hi,
Thanks for that bit of info. This may be a stupid question, but how
exactly does setting the variable @err help me with my current
situation? Will this allow me to generate a JDBC Exception or is it
something I'll need to change in the code to check if an error code has
been set? Thanks again!
Leigh