SQL: String;
The SQL property determines a line (SQL query) that must be executed at the database server. A physical name of the procedure or function stored at the server is passed as a query using IDalCommand.Type=StoredProcedure.
Sub Main;
Var
MB: IMetabase;
DB: IDatabaseInstance;
Com: IDalCommand;
Begin
MB := MetabaseClass.Active;
DB := MB.ItemById("BD").Open(Null) As IDatabaseInstance;
Com := DB.Connection.CreateCommand("");
Com.SQL := "Select * from Table_1";
Com.Execute;
Com.Close;
End Sub Main;
After executing the example the connection to the BD database is established, then the SQL query, which selects all records from the Table_1 table, is executed.
See also: