views:

56

answers:

2

I am using Informix DB and I need to take a backup of create table queries of each table present in the DB.I don't need to clone the database because my need is only the create scripts.I am using WinSql to access the DB.Any help would suffice.TIA

+1  A: 

I am unfamiliar with Informix, but Google results suggest that the dbschema utility can be used to generate SQL statements to script table and database creation for migration purposes, and it should meet your needs.

Do you have access to this utility?

Conspicuous Compiler
+2  A: 

As the Conspicuous Compiler suggests, the tool for the job is DB-Schema.

dbschema -d dbname -t table

This will give you the schema for a single table. Omit the '-t table' and it will give you the schema of the entire database, which you can then split up to suit yourself.

The only problem may be that you are using WinSQL to access the database. I'm familiar with its name but not its functionality. The chances are it uses an ODBC-based connection to access the database, in which case, you may - or may not - have access to DB-Schema. Is the DBMS on the same machine as the WinSQL client? If so, you probably do have DB-Schema and could use it. If not, then you may be in more difficulty.

Jonathan Leffler