Re: dbschema and dbexport now outputs "contraint ..." syntax
Posted in 1997
In article <33319540.41C67EA6@quantumsi.com>, Jon Strabala
><jon@quantumsi.com> writes
>>Hi,
>>
>>When transitioning from Informix 5.X to 7.X for
>>a client I discovered that the same engine appears
>>to randamly emit or not emit a new syntax as follows:
>>
>>5.X always
>> date_val date not null,
>>
>>7.X sometimes
>> date_val date not null constraint "rpts".n100_1,
>>
>>The real downside is that I can do a dbexport and
>>then a subsequent dbimport which breaks on the
>>the "constraint ..." stuff under 7.X, however if
>>I hand edit the file and remove the constrint stuff
>>the dbimport succeeds. Not a very good feature.
>>
>>Both dbexport and dbschema exhibit this behavior,
>>any idea of what is going on and how to stop it.
>>
>>- Jon A. Strabala
>> jon@quantumsi.com
>> PLEASE also E-MAIL responses - I will repost a summary
Hi Jon,
I have 7.20UC4 on DEC-UNIX3.2C. My experience with dbexport, dbschema
and dbimport are as follows
1. dbexport's .sql file ALWAYS has the constraints mentioned.
2. dbschema ALWAYS has the constraints mentioned.
3. dbimport NEVER has a problem with the statement.
P.S. I export all my databases daily (still wary of ontape). I have
imported my small databases any number of times (disk reorg and
for creation of test dbs)
I have no idea of how to stop the behaviour your engine is displaying,
but a simple sed filter can spare you the need for hand-editing.
dbschema -d dbname [-t table] | sed "s: constraint.*,:,:" | \\
sed "s: constraint.*$::"
HTH
----------------------
Rudy Fernandes (ICP)
GIC, Kuwait
----------------------