Re: Split table syntax and take out all constraints...
Posted in 2008
Just get my dbschema replacement utility, myschema. If you give it the
names of two output files it places all triggers, indexes and constraints
into the second file and the create table, create view, and UDT statements
into the first file. No sweat.
Myschema is contained in the package utils2_ak available for download from
the IIUG Software Repository (www.iiug.org/software) or the Oninit web
site. ( Recently uploaded an update to the file print_procedures.ec, and I
don't see that it has been posted yet, so if you have any trouble compiling
that file, let me know and I'll send you the update directly.)
Art
On Mon, Jul 14, 2008 at 4:24 AM, Mahdi Sbeih <mahdi.sbeih@gmail.com> wrote:
> Hi All,
>
> I have a dbschema output for a large database, and I want to create
> all tables as RAW tables first in order to load data and then change
> the type to STANDARD.
>
> My problem is that I can't create a RAW table if the table syntax
> contains constraints such as
> create table mytable
> (
> my_key serial not null ,
> my_name varchar(64) not null ,
> desc1 varchar(32) not null ,
> desc2 varchar(64) not null ,
> primary key (my_key) constraint pk_mytable
> );>
> Is there a way to split the above syntax into create and alters, so
> the alters will be the constraints such as
>
> create table mytable
> (
> my_key serial not null ,
> my_name varchar(64) not null ,
> desc1 varchar(32) not null ,
> desc2 varchar(64) not null
> );
> alter table mytable add constraint primary key (my_key) constraint> pk_mytable;
>
>
> Any other ideas?
>
>
> Thanks,
> Mahdi
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do those
opinions reflect those of other individuals affiliated with any entity with
which I am affiliated nor those of the entities themselves.