COPY TO (lcTableName) DATABASE DatabaseName
>I would like to create a snapshot of a DB2 database. I won't need the most current records so it seems feasible to me to pull down all the tables and store them locally (none of the tables are more than 25K records so space is not a consideration).
>
>In order to keep the full name of the fields I need to store it all in a database. So I now have an empty DBC called aw_data. I also have a free table (awstru) which contains a list of all the tables I will need to pull down. I can get the data into a cursor, but I don't remember (can't figure out, am missing something simple, etc.) how to get that cursor into the database.
>
>So far I have
>CREATE DATABASE aw_data
>USE awstru
>SCAN
> =SQLEXEC(myConn,"SELECT * FROM " + awstru.tablename)
> ** A miracle is needed to put SQLRESULT into aw_data as < awstru.tablename >
>ENDSCAN
>
>Could somebody please show me how to perform this miracle?
>
>Thanks to all
>
>.......Rich
--sb--