in reply to Re^2: Throw DB error
in thread Throw DB error

If you don't want to change your SQL then you will have to create a problem at the database end by ensuring some of your SQL fails - e.g., manually create a row which will cause a constraint to fail in your SQL, delete a key, change permissions etc. The possibilities are endless so I'm not listing all I can think of here.

Replies are listed 'Best First'.
Re^4: Throw DB error
by Bheema_Tyco (Novice) on Mar 03, 2010 at 12:01 UTC

    I am sorry again i am disturbing YOU. i don't want to change either in sql query or deleting rows. I am asking that, is there any mechanism in perl that a person can throw error intentionally. Because i am using

    $SIG{__WARN__} = \&WARN_Handler; $SIG{__DIE__} = \&DIE_Handler;

    And i also written code for handle error using WARN_HANDLER AND DIE_HANDLER

        WARN_Handler and DIE_Handler are the two sub routines i have defined. Whenever db throw errors these routine will get activated. i am calling these methods using SIG { } command See bellow code

        $SIG{__WARN__} = \&WARN_Handler; $SIG{__DIE__} = \&DIE_Handler;

        here &WARN_Handler and &DIE_Handler are the two sub routines OK. So now tell me how to throw db error as we in JAVA or some languages.