function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SwarnaSwarna 

Dynamic sql

How can I write a dynamic sql in apex code?

My need is to construct a SQL according to users inputs and so it has combinations that needs to be checked with several if conditions. I need to create the SQL with those conditions and combinations and then execute it. How can it be achieved?
The DevLife.ax318The DevLife.ax318

Swarna,

 

Right now, you can't do this. There will be a new feature that will be available in the Summer 08 release called Dynamic Apex that will allow you to do this.

Randy