I trying move table into another tablespace. (from SMS to DMS). I like use altobj procedure in my procedure for move table. when i drop original table, then cascade are dropped referential constraints... altobj is good method, but i need original ddl "create table " extract from database. Excuse my poor english.
The actual CREATE TABLE statement does not reside anywhere within the database. Probably because any subsequent ALTER TABLE statements would render it useless.
However, the DDL to create the table in its current format along with all triggers, indexes, and RI can be generated from the catalog (syscat-tables, columns, etc). This is how the ALTOBJ procedure and the Control Center genenerates the statements.
I am assuming you want this new stored procedure so that you can change lots of tables. Probably the simplest and easiest way to do this would be to use db2look to generate a script of the tables you want to move to another tablespace. Then edit the script to encapsulate the CREATE TABLE statements with calls to ALTOBJ.