HELP: Backup only selected data using TMyDump

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ton_cut345
Posts: 13
Joined: Fri 21 Aug 2009 04:12

HELP: Backup only selected data using TMyDump

Post by ton_cut345 » Tue 24 Apr 2012 05:09

Hi,

I need to know how to backup data using TMyDump on selected data on a certain tables.

I have 5 tables and each department stores employee information on those tables, each department can backup their own data only.

Example:

Table 1: Employee_Information
EmpID,DeptID,EmpName

Table 2: Employee_Children
ChildID,EmpID,ChildName,DOB

Table 3: Employee_Education
EducID,EmpID,EducationName

I need to backup all employee information, children, education whos DeptID=5

Is it possible to TMyDump? or is there a work around on this?

Thank you for your help guys.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 24 Apr 2012 14:40

Hello,

For implementing backup data fitting definite conditions, you can use the MyDump.BackupQuery method, that needs the query as a parameter selecting the needed data from the table. For example:

MyDump.BackupQuery('SELECT * FROM Employee_Information WHERE DeptID=5');

After running this method, the formed backup will be available in MyDump1.SQL.Text.

For backup data from several tables, you have to form a responding SQL for each table. If tables relation is used for retrieving the needed data, than the table, from which the data must be saved, must be the first after the From keyword in the SQL query.

ton_cut345
Posts: 13
Joined: Fri 21 Aug 2009 04:12

Post by ton_cut345 » Tue 24 Apr 2012 15:31

Roger that!

whhooww.. I thought I have to resolve calling mysql dll's..

this component is great.. :)

thanks guys..

Post Reply