Page 1 of 1

HELP: Backup only selected data using TMyDump

Posted: Tue 24 Apr 2012 05:09
by ton_cut345
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.

Posted: Tue 24 Apr 2012 14:40
by AlexP
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.

Posted: Tue 24 Apr 2012 15:31
by ton_cut345
Roger that!

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

this component is great.. :)

thanks guys..