You need to sign in to do that
Don't have an account?
Scott.M
Cost of Dynamic SOQL
What's the cost of using dynamic soql over standard soql queries. Is there any measurable difference between doing:
<pre>Database.query('select Id from Contact where Id=:contact_id'); </pre>
vs
<pre>[select Id from Contact where Id=:contact_id' ]; </pre>
If there is a performance difference, does the penalty increase with complexity of queries?
<pre>Database.query('select Id from Contact where Id=:contact_id'); </pre>
vs
<pre>[select Id from Contact where Id=:contact_id' ]; </pre>
If there is a performance difference, does the penalty increase with complexity of queries?
The database query method can be used wherever an inline SOQL query can be used, such as in regular assignment statements and for loops. The results are processed in much the same way as static SOQL queries are processed.
Dynamic SOQL queries have the same governor limits as static queries
So clearly, this is relative how you need it
Read more at http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_soql.htm