nerdexam
Salesforce

PDII · Question #84

Which statement is true regarding the use of user input as part of a dynamic SOQL query?

The correct answer is C. Quotes should be escaped to protect against SOQL injection. See the full explanation below for the reasoning.

Question

Which statement is true regarding the use of user input as part of a dynamic SOQL query?

Options

  • AFree text input should not be allowed, to avoid SOQL injection
  • BThe String.format() method should be used to prevent injection
  • CQuotes should be escaped to protect against SOQL injection
  • DThe string should be URL encoded by the input form to prevent errors

How the community answered

(47 responses)
  • A
    4% (2)
  • B
    11% (5)
  • C
    83% (39)
  • D
    2% (1)

Community Discussion

No community discussion yet for this question.

Full PDII Practice