CompTIA DataSys+ (DS0-002) free question 10 / 10 · Domain 6: Data Integration
A bulk load of a large file stops completely when it meets one malformed row. Which clause of the load command lets the DBA specify another behavior so a best-effort load can continue?
- The clause that names the character used to quote values
- The clause that names the character set of the file
- The clause that says whether the first line holds column names
- The clause that specifies how errors are handled
Show the answer and explanation
Answer: D
Why this is correct
The COPY page says that by default COPY fails if it encounters an error during processing, and that for use cases where a best-effort attempt at loading the entire file is desired, the ON_ERROR clause can be used to specify some other behavior. It is the documented remedy when one bad row stops a bulk load. The source reads: "By default, COPY will fail if it encounters an error during processing. For use cases where a best-effort attempt at loading the entire file is desired, the ON_ERROR clause can be used to specify some other behavior." Source page: COPY, section "Description".
Why the other options are wrong
"The clause that says whether the first line holds column names" … HEADER concerns the first line of the file and has no effect on how errors are treated.
"The clause that names the character set of the file" … ENCODING tells COPY how to interpret characters and does not change error handling.
"The clause that names the character used to quote values" … QUOTE affects parsing of quoted values and does not change the failure behavior.
Key points
ON_ERROR controls whether COPY stops on a bad row.