Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

SQLBuilder SQL not executed?

edited December 2004 in RAP
If I use the SQLBuilder methods to construct a SQL statement everything
works as it should. However, if I use the following code the SQL
statement is not executed at all. What do I need to do to make this
work?

var
SqlBldr: TdaSqlBuilder;
begin
aCancel := False;
SqlBldr := TdaSQLBuilder.Create(Report.DataPipeline);
SqlBldr.Clear;
SqlBldr.Sql.SqlText.Text :=
'SELECT * FROM CUSTOMER WHERE STATE = ''HI''';
end;

--
Bill Todd

Comments

  • edited December 2004

    I researched this.

    1. Always free the SQLBuilder object, the destructor will internally call
    the ApplyUpdates method.

    2. When modifying the SQLText it is necessary to create a temporary
    TStringList object as shown below. (This is something that we need to
    improve, but for now it is required).

    var
    lSQLBuilder: TdaSQLBuilder;
    lSQLText: TStringList;
    begin

    lSQLBuilder := TdaSQLBuilder.Create(ppReport1.DataPipeline);

    lSQLText := TStringList.Create;
    lSQLText.Text := 'Select * from customer';
    lSQLBuilder.SQL.SQLText := lSQLText;
    lSQLText.Free;

    lSQLBuilder.Free;
    end;

    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.