How to create file during import / export 
Author Message
 How to create file during import / export

Hi

I'm currently using UDB DB2 version 7.2 running on WIN2K

I need to do a scheduled housekeeping i.e to move some data from Table
A to Table B where Table B schema is the same as Table A except Table
B has an additional column i.e. the Date the record is inserted into
Table B.

The following is what I plan to do by using the DB2 Script center
where I can schedule the job.

Step 1. Export the required data using the export command, on error
create experr.log

Step 2. If theres no error in export, import the required data,
on error create imperr.log

Step 3. If theres no error in import, then delete the records,
on error create delete.log

Ok, here's where I need ur expertise

Q1. Is there a better way to move some data from Table A to Table B
(note that Table B has an additional column i.e. the date the record
is inserted) and that there's multiple of such tables that I need to
perform this task.

Q2. How can I create an error log file should there be error when
exporting/importing

That's it for the moment.. I thanked all in advance..

regards
lina



Tue, 10 Aug 2004 17:16:10 GMT
 How to create file during import / export

Hi,

Quote:
> Q1. Is there a better way to move some data from Table A to Table B
> (note that Table B has an additional column i.e. the date the record
> is inserted) and that there's multiple of such tables that I need to
> perform this task.

You can also use INSERT ... SELECT clause to move data between tables within
one database (or between different databases if they are configured as
federated databases).

For example, INSERT INTO tab1 SELECT col1, col2, ..., current date FROM tab2

In this case no additional data file required and performance can be
increased.

Quote:
> Q2. How can I create an error log file should there be error when
> exporting/importing

The export/import utilities allow writing log messages into a file, see the
option "messages" for details.
For logging SQL statements you can also set options in DB2 CLP to write
output in a file.

Best regards, Dmitry
--
http://www.ispirer.com/products/ - Data migration software for IBM DB2,
Oracle and MS SQL Server.


Quote:
> Hi

> I'm currently using UDB DB2 version 7.2 running on WIN2K

> I need to do a scheduled housekeeping i.e to move some data from Table
> A to Table B where Table B schema is the same as Table A except Table
> B has an additional column i.e. the Date the record is inserted into
> Table B.

> The following is what I plan to do by using the DB2 Script center
> where I can schedule the job.

> Step 1. Export the required data using the export command, on error
> create experr.log

> Step 2. If there’s no error in export, import the required data,
> on error create imperr.log

> Step 3. If there’s no error in import, then delete the records,
> on error create delete.log

> Ok, here's where I need ur expertise

> Q1. Is there a better way to move some data from Table A to Table B
> (note that Table B has an additional column i.e. the date the record
> is inserted) and that there's multiple of such tables that I need to
> perform this task.

> Q2. How can I create an error log file should there be error when
> exporting/importing

> That's it for the moment.. I thanked all in advance..

> regards
> lina



Tue, 10 Aug 2004 20:47:51 GMT
 How to create file during import / export
Hi Dmitry

thanks for the response.
Have thought of doing the Insert ..Select but then I need to provide
the col names which I'm avoiding cos' for any table changes , only the
table structures of Table A and Table B should change not the
scheduled housekeeping scripts...

Btw, I'm aware of the logging file generated during import/export
however, it seems to me that irregardless whether there's error or the
import/export completed successfully, it will be generated, however I
planned to generate an error log file i.e. only when an error occurs
... appreciate more info on how to set options in DB2 CLP to write
output in a file.

once again, appreciate all the assistance rendered

regards,
lina

Quote:

> Hi,

> > Q1. Is there a better way to move some data from Table A to Table B
> > (note that Table B has an additional column i.e. the date the record
> > is inserted) and that there's multiple of such tables that I need to
> > perform this task.

> You can also use INSERT ... SELECT clause to move data between tables within
> one database (or between different databases if they are configured as
> federated databases).

> For example, INSERT INTO tab1 SELECT col1, col2, ..., current date FROM tab2

> In this case no additional data file required and performance can be
> increased.

> > Q2. How can I create an error log file should there be error when
> > exporting/importing

> The export/import utilities allow writing log messages into a file, see the
> option "messages" for details.
> For logging SQL statements you can also set options in DB2 CLP to write
> output in a file.

> Best regards, Dmitry
> --
> http://www.ispirer.com/products/ - Data migration software for IBM DB2,
> Oracle and MS SQL Server.



> > Hi

> > I'm currently using UDB DB2 version 7.2 running on WIN2K

> > I need to do a scheduled housekeeping i.e to move some data from Table
> > A to Table B where Table B schema is the same as Table A except Table
> > B has an additional column i.e. the Date the record is inserted into
> > Table B.

> > The following is what I plan to do by using the DB2 Script center
> > where I can schedule the job.

> > Step 1. Export the required data using the export command, on error
> > create experr.log

> > Step 2. If theres no error in export, import the required data,
> > on error create imperr.log

> > Step 3. If theres no error in import, then delete the records,
> > on error create delete.log

> > Ok, here's where I need ur expertise

> > Q1. Is there a better way to move some data from Table A to Table B
> > (note that Table B has an additional column i.e. the date the record
> > is inserted) and that there's multiple of such tables that I need to
> > perform this task.

> > Q2. How can I create an error log file should there be error when
> > exporting/importing

> > That's it for the moment.. I thanked all in advance..

> > regards
> > lina



Fri, 13 Aug 2004 14:43:07 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Extra file created during export!

2. Upgrading from SQL 6.5 to 2000 - error during export and import via named pipes step

3. Importing text files into SQL Server 2000 Database using DTS Import/Export Wizard

4. SQL Server Upgrade Wizard Fails During Import/Export

5. Upgrading from SQL 6.5 to 2000 - error during export and import via named pipes step

6. I need to change size of constraints during export/import

7. erros during export/import

8. Change name file during a Export data

9. path to Access file is lost during scheduled DTS import

10. Rows missed during importing LARGE text file

11. Insert Trigger failing to fire during Import of csv file

12. Export problem (during .exporting posttable actions)


 
Powered by phpBB® Forum Software