MCQ Single Best Answer Easy

QYou are to complete the code needed to insert records. You need to ensure that a transaction completes successfully so that records are inserted into the database. Which will best complete this statement?

{
ttsbegin;
fmVehicle.dbVehicleID = ‘123456789’;
fmVehicle.insert();
 _________________ 
}

ID: #9390 Module 14: Database Manipulation 188 views
Question Info
#9390Q ID
EasyDifficulty
Module 14: Database ManipulationTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A ttsabort;
  • B insert;
  • C escape;
  • D ttscommit;
Correct Answer: Option D

Explanation

Justification:

  1. ttsAbort will prevent the data from being written to the table and roll the transaction back to the state before the ttsBegin was called.
  2. The insert method is called on table to insert data, but it does not control the transaction tracking system.
  3. This is not a valid command used for transaction integrity.
  4. This is correct. The ttsCommit command ensures there were no errors during the insertion process. After the ttsCommit is called, the data will be written to the given table.

 

Related Lesson: Data Insert

Share This Question

Challenge a friend or share with your study group.