Reputation: 609
I need to extract the create-table-sql of a table created in a database in Netezza, by using a query executed from a program. If there is any system table, stored procedure or otherwise, which let's me do that, please let me know. Your help will be highly appreciated.
Upvotes: 1
Views: 3153
Reputation: 11
If you have netezza SQL Aginity Editor 4.1 or above, then the following helps:
This will give you the SQL code required to create the table.
Upvotes: 0
Reputation: 27944
The create statements are not saved in a table, however you can query the table structure from the system tables in you database. A good start is NFORMATION_SCHEMA.COLUMNS:
select *
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME='tableName'
All information on the create parameters is stored in the system tables like TABLES.
Dumping information about a table:
exec sp_help 'tableName'
Upvotes: 1