IQuery.SQLText

Syntax

SQLText(Driver: String): String;

Parameters

Driver. DBMS driver identifier. The summary list of identifiers that can be specified as a parameter value is given in the Supported DBMS subsection.

Description

The SqlText property determines the text of SQL query to a database of the object Query for certain DBMS driver.

Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInf: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    Query: IQuery;
Begin
    MB := MetabaseClass.Active;
    CrInf := Mb.CreateCreateInfo;
    CrInf.ClassId := MetabaseObjectClass.KE_CLASS_QUERY;
    CrInf.Id := "New_Query";
    CrInf.Name := "New_Query";
    CrInf.Parent := Mb.Root;
    MObj := Mb.CreateObject(CrInf).Edit;
    Query := MObj As IQuery;
    Query.Database := Mb.ItemById("BD").Bind As IDatabase;
    Query.SqlText("ORCL8") := "SELECT * FROM Table_1 WHERE ROWNUM <= 10";
    Query.SqlText("MSSQL") := "SELECT TOP 10 * FROM Table_1";
    MObj.Save;
End Sub UserProc;

A new Query object is created in the root folder of repository after example execution. SQL queries in the DBMS Oracle and MSSQL formats are specified in the settings.

See also:

IQuery