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.
HELP: Backup only selected data using TMyDump
-
ton_cut345
- Posts: 13
- Joined: Fri 21 Aug 2009 04:12
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.
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