IQuery.SqlText

Syntax

SqlText(Driver: String): String;

Parameters

Driver. DBMS driver identifier.

Description

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

Comments

The list of identifiers that can be used as a value of the Driver parameter is given in the Summary List of Identifiers section.

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