sammeras
asked on
Different rows result between SELECT and UPDATE statments.
Hello,
I have strange behavior with select and update statment.
WHen i run the update statment:
::SEE UPDATE SCRIPT::
If i run the select statment...with the same condetion and values i got 81 rows:
::SEE SELECT SCRIPT::
Why i got different results ?
WHere is the problem? and how can resolve it?
Thanks.
Sam.
update.GIF
I have strange behavior with select and update statment.
WHen i run the update statment:
::SEE UPDATE SCRIPT::
If i run the select statment...with the same condetion and values i got 81 rows:
::SEE SELECT SCRIPT::
Why i got different results ?
WHere is the problem? and how can resolve it?
Thanks.
Sam.
--UPDATE SCRIPT
UPDATE end_camp_accounts tt SET
tt.LAST_ACTION_CODE = 6,
tt.last_action_date=sysdate+1,
tt.last_action_user='J83'
WHERE tt.last_action_code NOT IN (6,0,4)
AND tt.end_date <> trunc(sysdate+1)
AND (
end_camp_acc_is_active(tt.record_id) = 0
OR
end_camp_acc_is_hasava(tt.record_id) = 1
OR
end_camp_want_disconnect(tt.record_id)=1
OR
end_camp_want_hasava(tt.record_id)=1
);
2462 rows updateed.
-- ####################################
-- SELECT SCRIPT
SELECT
record_id
FROM end_camp_accounts tt
WHERE tt.last_action_code NOT IN (6,0,4)
AND tt.end_date <> trunc(sysdate+1)
AND (
end_camp_acc_is_active(tt.record_id) = 0
OR
end_camp_acc_is_hasava(tt.record_id) = 1
OR
end_camp_want_disconnect(tt.record_id)=1
OR
end_camp_want_hasava(tt.record_id)=1
);
81 rows selected.
select.GIFupdate.GIF
ASKER
The query shows 81 results.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
one chance is that u may have select policies for specific users on that table
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the proposed answer will not fix the counts.
It is clearly because the table has triggers defined on it. That count mismatch will appear in whatever way the updates are done.
It is clearly because the table has triggers defined on it. That count mismatch will appear in whatever way the updates are done.
query.txt