Computing.Net > Forums > Database > Whats wrong in the trigger

Whats wrong in the trigger

Reply to Message Icon

Original Message
Name: satishvvk
Date: February 21, 2007 at 23:51:31 Pacific
Subject: Whats wrong in the trigger
OS: UNIX
CPU/Ram: 256MB
Model/Manufacturer: intel
Comment:

CREATE OR REPLACE TRIGGER Emp_count AFTER DELETE ON Emp_tab
FOR EACH ROW
DELCARE n INTEGER;
BEGIN SELECT COUNT(*) INTO n FROM Emp_tab; DMBS_OUTPUT.PUT_LINE( . There are now . || a || . employees, .); END;
This trigger results in an error after this SQL statement is entered: DELETE FROM Emp_tab WHERE Empno = 7499;

Appricaite if u can post clear idea of resolution....



Report Offensive Message For Removal

Response Number 1
Name: Stephen Hall
Date: March 3, 2007 at 10:29:05 Pacific
Subject: Whats wrong in the trigger
Reply: (edit)

satishvvk,

I'm no expert here and don't even know what RDBMS you're using (doesn't really look like MS SQL, but again, I could be _very_ wrong). Regardless, I think if anyone is to help, it might be good to know what the error message is. :)

Just taking a stab in the dark, why do you move from using "n" ("BEGIN SELECT COUNT(*) INTO n") to "a" ("There are now . || a || . employees,"). Just a thought, but I would think your variables should match (i.e. the "a" should be an "n").

Stephen


"Live long and PROGRAM......or at least do _something_ with all that time...!"


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Whats wrong in the trigger

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software