Bind variables should be used in SQL statements
-
True
-
False
Reveal answer
Fill a bubble to check yourself
A
Correct answer
Explanation
Bind variables (parameters) should always be used in SQL statements instead of concatenating values. This prevents SQL injection attacks, improves query performance through cursor sharing, and enhances security by separating code from data.
AI explanation
True is correct. Bind variables (placeholders like :id bound at execute time) let the database reuse a single parsed/optimized execution plan across many executions instead of hard-parsing a new literal-laden statement each time, improving performance and reducing shared-pool/library-cache churn. They also prevent SQL injection, since user input is passed as data rather than concatenated into the SQL text.