0

I am wondering if someone knows how to export only the table SQL from a db2 database. I want a file that has the SQL to recreate the table without the data in another database environment.

I need this a query. I know db2look has the capability but, I need a query I can run in the database to do this.

chantheman
  • 5,256
  • 4
  • 23
  • 34
  • Do you have access to the iSeries navigator? you can get the create table script from there... – Leslie May 09 '11 at 15:16

1 Answers1

0

Because you don't have privileges to run db2look? You're going to need SELECT privileges on the system catalog tables anyway. And depending on what you try to do, you might also need sysadm, sysctrl, sysmaint, or dbadm.

Metadata is in the SYSIBM schema. The answers here should point you in the right direction.

Community
  • 1
  • 1
Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185
  • Thanks for the response. But no it is because I want to run it as a JDBC statement and have it dump to a file. I will check out the link. Thanks. – chantheman May 02 '11 at 18:55