Re: Changing size of Char field
Posted in 1997
Lisa (AKA umacru) wrote:
|We are running Informix SQL 4.1 on a DEC Ultrix machine.
More likely you're walking it. ;-)
|There is a char field that currently has a length of 5 characters that
|we would like to change to at least 6 (7 might be safer), but I want to
|make sure this isn't going to somehow screw up the current database.
|This field is used in several different tables and reports (one table
|currently has 6000 rows, another has 66,000, and this is a required
|field in several tables). I know that if we decide to do this, every
|table/report that the field appears in will need modification (there is
|a way I could get around needing to do this, but in anticipation of
|future needs, if we're going to do it, now would be the time).
Lisa,
you appear to be a candidate for the ALTER TABLE command. Suppose the
table is called yutz and the 5-char column is called yazoo:
in dbaccess (or isql) enter the command:
ALTER TABLE yutz modify (yazoo char(7));
That's it. We all strongly recommend you back up your database first.
If you have no DBA, chances are you have insufficient log space for a
moderate sized alter-table command.
This is documented in the Guide to SQL: Syntax, a book you should have
at your site.
|Lisa
PS Lisa, your reply-to address is screwed up. Please find a system
admin person to unscrew it. This is the only reason I am posting rather
than replying by e-mail.
--
-- Jake (Never yelled "CROWDED THEATER!" during a fire)
+------------------------------------------------------------+
| The expedient performance of a task with excessive concern |
| regarding its duration-to-completion engenders a virtual |
| certainty of diminished benefit therefrom. |
| -- Benjamin Franklin (but he said it in 3 words) |
+------------------------------------------------------------+