Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the DDL to create some tables?

Status
Not open for further replies.

mm8294

MIS
Oct 12, 2001
73
0
0
US
We have an Informix database and the boss want me to get the script to create 90 existing tables. He does not really want to recreate those existing tables, but he want the DDL script. Does anybody know how to do it in Informix? Don't tell me I have no alternative but doing it manually.

Thanks a lot.
 
By the way, the boss want the commands to grant the privileges on those tables (such as 'GRANT select ON table_name to User_name) be included in the file. I don't know if this is possible.

Thanks.
 
MM8294:

Informix has the dbschema utility that creates the schema for a single table or the whole database:

dbschema -t all -d <dbname> -p all <outputfilename>

This does the whole database, but if all your table names are in tmpfile:

while read file
do
dbschema -t $file -d <dbname -p all &quot;$file&quot;.sql
done < tmpfile

Regards,


Ed
Schaefer

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top