I have a question.
How can I get the results of MyScript or MyCommand queries as in MySQL console?
For example:
Code: Select all
Query ok: xx rows affected, (yy seconds)Code: Select all
Error xxx: cannot do yyyThanks
Code: Select all
Query ok: xx rows affected, (yy seconds)Code: Select all
Error xxx: cannot do yyyCode: Select all
MyScript1.SQL.Clear;
MyScript1.SQL.Add('UPDATE emp SET empno=empno;');
MyScript1.SQL.Add('SELECT * FROM emp;');
MyScript1.SQL.Add('SELECT * FROM dept;');
MyScript1.DataSet := MyQuery1;
MyScript1.ExecuteNext;
ShowMessage('Affected rows count: ' + IntToStr(MyQuery1.RowsAffected));
DataSource1.DataSet := MyQuery1;
MyScript1.ExecuteNext; // display the `emp` table
ShowMessage('The `emp` table is displayed');
MyScript1.ExecuteNext; // display the `dept` table
ShowMessage('The `dept` table is displayed');Yes, you should.GuzunNicolae wrote:What about the time in which the query executes? Should I calculate it by myself?
You can get the matched rows count from the TMyQuery.RowsAffected property. MyDAC does not support functionality with returning information about changed recodrs count, and warnings count.GuzunNicolae wrote:How I can get matched rows and warnings?
You can handle errors in the TMyScript.OnError event, and cache their messages.GuzunNicolae wrote:And how can I get the last error message of a script or command?