Click here to Skip to main content
15,923,273 members
Home / Discussions / Database
   

Database

 
Question[Message Deleted] Pin
B879-Nov-08 19:58
B879-Nov-08 19:58 
AnswerRe: Adding Pin
Ashfield9-Nov-08 20:20
Ashfield9-Nov-08 20:20 
QuestionHow do I create Database Script? Pin
graced889-Nov-08 15:14
graced889-Nov-08 15:14 
AnswerRe: How do I create Database Script? Pin
Wendelius10-Nov-08 4:49
mentorWendelius10-Nov-08 4:49 
GeneralRe: How do I create Database Script? Pin
graced8810-Nov-08 5:09
graced8810-Nov-08 5:09 
GeneralRe: How do I create Database Script? Pin
graced8810-Nov-08 5:12
graced8810-Nov-08 5:12 
GeneralRe: How do I create Database Script? Pin
Wendelius10-Nov-08 5:27
mentorWendelius10-Nov-08 5:27 
Questionabout combo box Pin
cutedrew9-Nov-08 15:00
cutedrew9-Nov-08 15:00 
AnswerRe: about combo box Pin
Ashfield9-Nov-08 20:22
Ashfield9-Nov-08 20:22 
QuestionDeploy SQL database Pin
Mohammad Rastkar9-Nov-08 1:13
Mohammad Rastkar9-Nov-08 1:13 
AnswerRe: Deploy SQL database Pin
Wendelius9-Nov-08 7:49
mentorWendelius9-Nov-08 7:49 
GeneralRe: Deploy SQL database Pin
Mohammad Rastkar10-Nov-08 8:44
Mohammad Rastkar10-Nov-08 8:44 
GeneralRe: Deploy SQL database Pin
Wendelius10-Nov-08 9:08
mentorWendelius10-Nov-08 9:08 
QuestionUpdating a view Pin
Yoyosch8-Nov-08 13:14
Yoyosch8-Nov-08 13:14 
AnswerRe: Updating a view Pin
Wendelius9-Nov-08 8:00
mentorWendelius9-Nov-08 8:00 
AnswerRe: Updating a view Pin
Syed Mehroz Alam9-Nov-08 18:47
Syed Mehroz Alam9-Nov-08 18:47 
QuestionHOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
harsha_mec3457-Nov-08 23:26
harsha_mec3457-Nov-08 23:26 
AnswerRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
Wendelius8-Nov-08 0:57
mentorWendelius8-Nov-08 0:57 
GeneralRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
harsha_mec3458-Nov-08 21:02
harsha_mec3458-Nov-08 21:02 
GeneralRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
Wendelius8-Nov-08 21:30
mentorWendelius8-Nov-08 21:30 
Seems that you're using Oracle, correct?

If so, there's no virtual tables (inserted and deleted) in Oracle. Instead, you can use a trigger like you wrote.

The reason why sql%found isn't returning a value is that you are not executing any sql inside the trigger (sql&found is used for the last executed statement inside a pl/sql block).

Also the trigger is executed only once per statement. One way to handle this is that you modify the trigger to fire every time row is updated. So basically your trigger could look like this:
create or replace trigger emp_dml_counter 
after update on emp 
for each row
as 
begin
  insert into emp_track values('update',1);
end;


If you want to combine different statement types (insert, update and delete) to the same trigger, you can use :NEW and :OLD variables to check if the row is new, updated or deleted.

This is now Oracle specific so these suggestions won't work in SQL Server. You we're using Oracle?

Mika

The need to optimize rises from a bad design.

My articles[^]

GeneralRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
harsha_mec3459-Nov-08 1:16
harsha_mec3459-Nov-08 1:16 
GeneralRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
Wendelius9-Nov-08 7:42
mentorWendelius9-Nov-08 7:42 
GeneralRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
harsha_mec34510-Nov-08 21:00
harsha_mec34510-Nov-08 21:00 
GeneralRe: HOW TO FIND NO.OF ROWS UPDATED IN ONE TABLE TO STORE THAT VALUE IN OTHER TABLE Pin
Wendelius11-Nov-08 8:42
mentorWendelius11-Nov-08 8:42 
QuestionJoining to same table to display values next to each other Pin
Support1237-Nov-08 21:18
Support1237-Nov-08 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.