For example, I query the database,
SELECT SALARY, WEEKLY_HOURS FROM EMPLOYEE WHERE EMP_ID = 999
Then I compare SALARY and WEEKLY_HOURS to local variables. If my local values are different, I ran an update query:
UPDATE EMPLOYEE SET SALARY = 255, WEEKLY_HOURS = 72 WHERE EMP_ID = 999
And if the values are no difference, I skip the update query.
So my question is, am I able to do the comparison and update in one query without stored procedure? Just trying to save one round trip.
Thanks.