Mysql Error handling
- Which keyword suppresses errors?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
In MySQL, to suppress errors, IGNORE keyword is used with INSERT or UPDATE statements. With the IGNORE clause, statements that would result in an error due to invalid values result only in a warning.
- Which mode is a shorthand for ‘both strict modes plus a bunch of other restrictions’?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
In MySQL, the ‘TRADITIONAL’ mode is used to enable the strict mode. It also enables all of the additional restrictions by the command ‘SET sql_mod = ‘TRADITIONAL” The other SQL modes have other functions.
- Which mode prevents MySQL to perform full checking of date parts?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
In MySQL, it is also possible to selectively weaken the strict mode at some places. If the ALLOW_INVALID_DATES SQL mode is enabled, MySQL doesn’t perform full checking of the date parts.
- Which mode is used to turn on strict mode and all of the additional restrictions?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The ‘TRADITIONAL’ mode is used to enable the strict mode and all of the additional restrictions. It is done by the command SET sql_mod = ‘TRADITIONAL’; The other SQL modes have other functions.
- Which mode prevents entry of the ‘zero’ date value in strict mode?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The ‘NO_ZERO_DATE’ prevents the entry of the ‘zero’ date value in strict mode. In MySQL, to suppress errors, the IGNORE keyword is used with INSERT or UPDATE statements.