Execute Query on Virtual Table

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Execute Query on Virtual Table

Post by ben » Tue 13 Sep 2005 23:21

Hello,

I have a virtual table with 100 records and i need to change a record without using locate, something like

UPDATE virtualtable SET something=1 WHERE something_else=10

any idea?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 14 Sep 2005 07:25

SQL statements is not supported by TVirtualTable.
Use something like this:

Code: Select all

tbl.First;
while not tbl.eof do begin
    if tbl.Fileds[] = ... then
        ...
    tbl.Next;
end;

ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Post by ben » Wed 14 Sep 2005 18:27

that will cause the cursor on the table to be moved.

anyway i will use the internal HEAP tables of MySQL

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Wed 14 Sep 2005 21:31

Hi, the best is to use MySQL's temporary tables, they work nice, fast and have full SQL support ;)

ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Post by ben » Wed 14 Sep 2005 23:48

question about memory tables, if the mysql sever is remotely on another pc, the data is held to the local or remote pc? I mean everytime i update the data, their travelling around the network?

alec
Posts: 20
Joined: Wed 24 Aug 2005 09:28
Location: Africa

Post by alec » Thu 15 Sep 2005 03:32

ben wrote:if the mysql sever is remotely on another pc, the data is held to the local or remote pc?
on remoute pc (mysql server pc) of course.
ben wrote: I mean everytime i update the data, their travelling around the network?
If it is critical moment, then you can try to use additional embedded mysql server (see TMyEmbConnection in MyDAC 4+) on client pc.
I think MySQL Embedded also support temporary tables and MEMORY (HEAP) stored engine.

Post Reply