How to execute a SOQL query using APEX?

String soql = "SOQL Query";
list_namae = Database.(soql);

Example:

List<Account> acc {get; set;}
String soql = "SELECT Name FROM Account";
acc = Database.query(soql);


Cheers!!!

No comments:

Post a Comment