Interview Questions

What happens “Update” command is used without where clause ?

SAP Reports,SAP DB,ALE, SAP Tables questions and answers


(Continued from previous question...)

What happens “Update” command is used without where clause ?

Answer1:
It will update all the records with same name in the particular field of the table.

Answer2:
If we dont mention "WHERE" clause in the UPDATE statement, it will update all records satisfying the given condition (if given any ) in the table !

Answer3:
Based on query condition. it will update all the fields which are mentioned in the query.
ex: update employee set firstname= @firstname,lastname=@lastname where employee_id =@employee_id.
so in the above case nothing wil be happen if you used where clause or not.
if you have many statements in the query you need to use the where clause.

(Continued on next question...)

Other Interview Questions