Re: INFORMIX-4GL 4.0 upgrade problem - reserved words/column names
Posted in 1991
Will Johnson writes:
> I found that I had long ago created this
> table with a column named length, which also is a reserved word. This
> did not bother the previous versions of INFORMIX-4GL, but the 4.0 SE
> engine is another matter.
> Unfortunately, INFORMIX-4GL considers it a syntax error to have
> 'length' in the following statement:
> RENAME COLUMN media.length TO media_length
> Has anyone else encountered this kind of problem? How about a simple
> circumvention?
Here's the first way out of the trap that comes to my mind:
1) Make sure you have a separate ascii file containing the SQL definition
of the media table; use dbschema to create one if you don't.
2) Edit the SQL definition of the table, changing the name of the length
column, and changing the name of the table to xmedia, or somesuch.
3) Create a new table using this modified definition.
4) Copy the contents of the old table to the new one:
insert into xmedia select * from media.5) Drop the old table.
6) Rename table xmedia to media.
There may be easier ways; e.g. it's conceivable that ISQL would accept
the "rename" statement, or that its table editor would be able to handle
this, but since you don't mention having ISQL available, I haven't checked.
The method above should work from 4GL as well as ISQL.
Good Luck!
Harry Bochner
bochner@das.harvard.edu