Page 1 of 1

TOraXML issue

Posted: Mon 10 Jan 2005 09:38
by Iasen
I have the follow problem:
1. I'm using TSmartQuery and TOraXML and ODAC 4.50 and Delphi 7.1.
2. The SQL script below has to return 5 records but it return only one.

Where is my mistake or there is some bug in the components?

Thanks in advance,
Iasen Drenski


with SmartQueryXML do
begin
Close;
SQL.Clear;
SQL.Add('select XMLElement("ORD_BANKCODE",t.mt_100_ord_bae) XML ');
SQL.Add('from mt_100_datap t ');
SQL.Add('where rownum<=5');

Open;
i:=SmartQueryXML.Fields.Count;
Memo1.Lines.Text:=TOraXMLField(FieldByName('XML')).AsXML.AsString;
Memo1.Lines.Add('Counted records: '+IntToStr(i));

Close;
end;

Posted: Mon 10 Jan 2005 13:26
by Paul
SmartQueryXML.Fields.Count returns the number of columns in result set. Please set SmartQueryXML.Options.QueryRecCount=True to use SmartQueryXML.RecordCount instead.