Home » SQL & PL/SQL » SQL & PL/SQL » UPDATING() Doubt (Oracle9i,Windows XP)
icon5.gif  UPDATING() Doubt [message #377165] Sun, 21 December 2008 02:12 Go to next message
kperumal75
Messages: 3
Registered: November 2008
Junior Member
Friends,

Read the following ques:
88. Examine this trigger.
CREATE OR REPLACE TRIGGER UPD_TEAM_SALARY
AFTER INSERT OR UPDATE OR DELETE ON PLAYER
FOR EACH ROW
BEGIN
UPDATE TEAM
SET TOT_SALARY=TOT_SALARY+:NEW SALARY.
WHERE ID=:NEW:TEAM_ID;
You will be adding additional coat later but for now you want the current block to
fire when updated the salary column. Which solution should you use to verify that
the user is performing an update on the salary column?
A. ROW_UPDATE(‘SALARY’)
B. UPDATING(‘SALARY’)
C. CHANGING(‘SALARY’)
D. COLUMN_UPDATE(‘SALARY’)

Answer: B

I tried to execute answer but it says wrong arguments:

EXECUTE UPDATING('Karthik');

BEGIN UPDATING('SALARY'); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'UPDATING'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

What is the format of the updating() func or procedure?
Thanks in advance,
Karthik Smile
Re: UPDATING() Doubt [message #377167 is a reply to message #377165] Sun, 21 December 2008 02:44 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Now would be a good moment to check the documentation
Re: UPDATING() Doubt [message #377168 is a reply to message #377167] Sun, 21 December 2008 02:51 Go to previous message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
B is indeed correct. The trigger should have:

IF UPDATING ('SALARY') THEN
   UPDATE ... 
END IF;

Previous Topic: Package
Next Topic: PL/SQL - Using a Param both as Value and Key
Goto Forum:
  


Current Time: Sun Dec 04 10:56:01 CST 2016

Total time taken to generate the page: 0.07585 seconds