Hi Experts,
I would like to mentione here i was trying to test one package and found the package has a procedure named SET() which hav UPDATE on Report table and INSERT on A_R table in same transaction
Both the above mentioned tables hav a tim_upt column which s given as systimestamp
and strange it was the second insert reflects the correct timestamp whereas the UPDATE (Report table) s not reflecting the tim_upt
Though it is like this..
procedure set(tim_upt -- parameter varaible)
BEGIN
UPDATE Report
set different attributes,
tim_upt = systimestamp
where
some condition;
Insert into A_R (......,tim_upt)values(....systimestamp);
Exception
when others then
raise_appl_err(.........);
END;
It compiles without any error ,on run of test for that set of tables it is not throwing any exception and but the 1st table is not reflected with time of update ...
pls guide me on this
Hello,
Yes i checked with sqlcount -- its don't hav rows to update,but the update column and INSERT column on second table are same,defeintly if record Insert happening,UPDATEshould also happen
It looks strange
Any table creation criteria stops from this update??
Inserts don't include a condition. Anytime you execute an insert, the desired row will be inserted unless an error occurs, on the other hand updates will affect only rows satisfying the WHERE clause (if it is present). So, the fact that the insert is being done doesn't mean the update will for sure affect some row, because it have a WHERE clause that needs to be satisfied.
The WHERE clause of the update statement is key here.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 5  Replies